:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; color: #293831; background: #f5f7f2; font-synthesis: none;
  --green: #285843; --muted: #657066; --line: #e1e6dc;
}
* { box-sizing: border-box; }
body { margin: 0; }
body.drawer-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 1px solid #d4ddce; background: white; color: #38473f; border-radius: 7px; padding: 9px 12px; font-weight: 500; transition: background .15s; }
button:hover { background: #f0f4ed; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #aacbb8; outline-offset: 2px; }
a { color: var(--green); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main { min-width: 0; }
.topbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: #fcfdf9; }
.brand { display: flex; gap: 10px; align-items: center; color: #2e4b38; text-decoration: none; letter-spacing: .5px; font-size: 15px; font-weight: 750; }
.brand-mark { width: 38px; height: 38px; flex-shrink: 0; border-radius: 9px; background: #285843; color: #e7edcd; display: grid; place-items: center; font: bold 27px Georgia, serif; letter-spacing: -2px; padding-bottom: 3px; }
.brand small { display: block; margin-top: 3px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
#today { color: var(--muted); font-size: 14px; margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.connection { font-size: 14px; display: flex; gap: 5px; align-items: center; padding: 9px 11px; white-space: nowrap; }
.small-dot, .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #d3a65a; flex-shrink: 0; }
.connection.online .small-dot { background: #70a87f; }
.amber { background: #c69b4c; } .red { background: #c8806d; }
.icon-button { border: 0; background: none; padding: 9px; }
.content { padding: 16px 24px 24px; max-width: 1600px; margin: auto; }
.banner { display: flex; align-items: center; gap: 10px; border: 1px solid #d9e4c4; background: #edf3e2; color: #526439; padding: 7px 11px; border-radius: 7px; margin-bottom: 16px; font-size: 13px; }
.banner strong { font-size: 11px; white-space: nowrap; letter-spacing: .4px; }
.banner button { margin-left: auto; border: 0; background: transparent; padding: 4px; font-size: 14px; color: #3e6338; white-space: nowrap; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.page-nav { display: flex; gap: 6px; margin-bottom: 15px; }
.page-nav button { border-color: transparent; background: transparent; color: #6c7c62; padding: 7px 10px; font-size: 15px; }
.page-nav button.selected { background: #e4eddc; color: #315638; border-color: #cfddc4; }
.button-link { display: inline-flex; align-items: center; text-decoration: none; border: 1px solid #d4ddce; border-radius: 7px; background: white; padding: 9px 12px; font-size: 15px; }
.archive-note { border: 1px solid #dce4d1; border-radius: 8px; background: #edf3e6; padding: 10px 14px; margin-bottom: 12px; }
.archive-note p { margin: 5px 0; font-size: 15px; line-height: 1.6; }
.archive-note .muted { font-size: 13px; }
.customer-search { max-width: 450px; margin: 10px 0 12px; }
.customer-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: white; }
.customer-record { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 13px 15px; text-align: left; }
.customer-record:last-child { border-bottom: 0; }
.customer-record-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.customer-record-info strong { display: block; font-size: 17px; font-weight: 650; }
.customer-record-info > span, .customer-record-meta small { display: block; font-size: 13px; color: var(--muted); margin-top: 5px; }
.customer-record-meta { text-align: right; font-size: 15px; }
.customer-pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 13px; font-size: 14px; }
h1 { font-size: 27px; font-weight: 650; letter-spacing: -.7px; margin: 0; line-height: 1.25; }
.stats { display: flex; gap: 8px; }
.stat { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; font-size: 14px; color: #5a6856; white-space: nowrap; }
.stat strong { font-size: 19px; font-weight: 650; color: #34543d; line-height: 1; }
.stat.selected { background: #e7eee0; border-color: #9eb897; }
.inbox { border: 1px solid var(--line); border-radius: 10px; background: white; overflow: hidden; }
.toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 15px; }
.tabs { display: flex; gap: 2px; padding: 3px; background: #f1f4ed; border-radius: 7px; }
.tabs button { border: 0; background: none; font-size: 15px; padding: 8px 12px; white-space: nowrap; color: #65715d; }
.tabs .selected { background: white; color: #31553b; box-shadow: 0 1px 3px #33442c16; }
.toolbar input { width: min(340px, 40%); margin: 0 0 0 auto; font-size: 16px; padding: 9px 11px; }
.refresh { font-size: 22px; padding: 5px 10px; border-color: transparent; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 16px; table-layout: fixed; }
thead { background: #f5f7f1; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: .2px; font-weight: 650; color: #5b6b53; padding: 11px 14px; }
th:first-child { width: 54%; padding-left: 16px; } th:nth-child(2) { width: 16%; } th:nth-child(3) { width: 17%; } th:last-child { width: 13%; }
td { padding: 14px; border-bottom: 1px solid #e9eee2; vertical-align: top; }
td:first-child { padding-left: 16px; }
tbody tr { cursor: pointer; } tbody tr:hover { background: #f8fbf4; }
td > strong { display: block; font-weight: 550; font-size: 16px; }
td > small { display: block; color: #6e7c65; font-size: 13px; margin-top: 5px; line-height: 1.4; }
.customer-cell { display: flex; align-items: flex-start; gap: 11px; }
.customer-info { min-width: 0; flex: 1; }
.customer-avatar { display: grid; place-items: center; width: 35px; height: 35px; flex-shrink: 0; border-radius: 9px; font-size: 13px; font-weight: 650; }
.tone-0 { background: #ece8db; color: #7e682d; } .tone-1 { background: #e4ece0; color: #4e7136; }
.tone-2 { background: #e1e9ee; color: #42677d; } .tone-3 { background: #efe4df; color: #895f46; }
.customer-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 10px; }
.customer-name { display: block; font-weight: 650; font-size: 17px; text-align: left; padding: 0; border: 0; border-radius: 0; background: none; color: #2f4334; }
.customer-name:hover { background: none; text-decoration: underline; }
.message-count { font-size: 13px; color: #74816a; }
.request-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; color: #56644d; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.row-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-thumb { position: relative; display: inline-flex; justify-content: center; align-items: center; width: 88px; height: 100px; padding: 0; border: 1px solid #dfe5d7; overflow: hidden; background: #edf0e7; border-radius: 7px; flex-shrink: 0; }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.image-thumb:hover { border-color: #6c916f; }
.image-zoom { position: absolute; right: 3px; bottom: 3px; padding: 0 4px; background: #183b2b9c; color: white; border-radius: 3px; line-height: 1.2; font-size: 18px; }
.image-fallback { display: none; color: #6d775f; font-size: 12px; line-height: 1.5; font-weight: 400; text-align: center; padding: 4px; }
.image-fallback small { font-size: 10px; }
.image-failed img, .image-failed .image-zoom { display: none; } .image-failed .image-fallback { display: block; }
.more-images { width: 60px; border: 1px dashed #c6d3bc; font-size: 22px; color: #547245; padding: 5px; } .more-images small { font-size: 12px; display: block; margin-top: 3px; }
.action-cell { text-align: right; }
.complete-button, .reopen-button { font-size: 14px; white-space: nowrap; padding: 9px 10px; }
.complete-button { background: #edf3e8; color: #34613c; border-color: #d3e0c7; }
.complete-button:hover { background: #dae9d0; }
.reopen-button { color: #64725c; border-color: #dce3d6; }
.view-request { border: 0; background: none; display: block; margin: 8px 0 0 auto; padding: 2px 3px; font-size: 13px; color: #6e7d64; }
.completed-row .customer-name { color: #65765d; }
.overdue strong, .overdue small { color: #a6452f; }
.analysis-note { display: block; color: #937337; font-size: 13px; line-height: 1.5; margin-top: 8px; }
.table-footer { padding: 11px 16px; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #6f7d63; background: #fdfefb; }
.footnote { font-size: 13px; color: #6f7d63; margin: 11px 0 0; line-height: 1.6; }
.empty { text-align: center; padding: 30px 18px; color: #6f7d63; }
.empty > span { font-size: 30px; color: #8da27b; } .empty h3 { font-size: 18px; color: #596a4e; } .empty p { font-size: 15px; }
.primary { background: #2b5b43; border-color: #2b5b43; color: white; } .primary:hover { background: #204a35; }
.overlay { position: fixed; inset: 0; background: #11251a55; z-index: 10; backdrop-filter: blur(2px); }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(650px, 100%); background: white; z-index: 11; overflow: auto; overscroll-behavior: contain; box-shadow: -10px 0 50px #0f27151a; }
.drawer-header { position: sticky; top: 0; background: white; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; z-index: 1; font-size: 13px; color: #627558; }
.detail-title { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
h2 { font-size: 22px; margin: 0 0 4px; } .detail-title > div { min-width: 0; }
.detail-title p { font-size: 13px; line-height: 1.5; color: var(--muted); margin: 0; }
.detail-complete { margin-left: auto; flex-shrink: 0; }
.detail-summary { padding: 0 18px 15px; }
.summary { font-size: 17px; line-height: 1.65; white-space: pre-wrap; margin: 8px 0 12px; overflow-wrap: anywhere; }
.deadline-summary { display: flex; flex-wrap: wrap; gap: 7px 12px; align-items: baseline; font-size: 16px; }
.deadline-summary > span { color: var(--muted); } .deadline-summary strong { font-weight: 600; } .deadline-summary small { color: var(--muted); font-size: 12px; }
blockquote { margin: 8px 0 0; border-left: 2px solid #bdcdb0; padding: 2px 9px; font-size: 14px; line-height: 1.5; color: #6c7b62; }
.promise { color: #66785b; font-size: 14px; margin: 9px 0; } .promise strong { font-weight: 550; }
summary { cursor: pointer; font-size: 14px; color: #58734c; padding: 9px 0; width: fit-content; }
#deadline-editor { margin-top: 2px; } #deadline-form { background: #f7f9f3; border-radius: 7px; padding: 12px; margin-top: 3px; }
.detail-section { border-top: 1px solid var(--line); padding: 12px 18px 16px; }
h3 { font-size: 18px; font-weight: 650; margin: 0 0 10px; }
.conversation-heading { display: flex; justify-content: space-between; align-items: center; } .conversation-heading h3 { margin: 0; }
.conversation-heading span { color: #667b57; font-size: 14px; margin-left: 5px; }
.conversation-heading button { font-size: 22px; border: 0; padding: 3px 7px; }
.messages { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.message { background: #f5f6f1; border: 1px solid #e5ebdc; border-radius: 8px; padding: 11px 12px; max-width: 95%; align-self: flex-start; width: 95%; }
.message.outbound { background: #edf4e8; border-color: #dbe7cb; align-self: flex-end; }
.message-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 10px; font-size: 13px; } .message-meta span { color: #68785e; }
.message p { font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 7px 0 3px; }
.message small { display: block; font-size: 12px; color: #896e33; margin-top: 7px; }
.message-media { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.conversation-image { width: min(190px, 100%); height: 225px; }
.attachment { font-size: 15px; color: #4f713f; overflow-wrap: anywhere; max-width: 100%; }
.other-options { margin: 0 18px 16px; border-top: 1px solid var(--line); padding-top: 5px; } .other-options button { font-size: 14px; }
label { display: block; font-size: 14px; margin-bottom: 12px; color: #526b42; }
input, select, textarea { display: block; width: 100%; border: 1px solid #d2ddc9; border-radius: 6px; background: white; padding: 10px; margin-top: 6px; color: #3c4e33; font-size: 16px; }
textarea { resize: vertical; line-height: 1.6; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 16px; } .check-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; } .button-row button { font-size: 15px; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 16px; align-items: center; background: #254b35; color: white; padding: 12px 16px; border-radius: 8px; box-shadow: 0 4px 30px #10261722; z-index: 30; font-size: 15px; width: max-content; max-width: 94vw; }
.toast button { color: #e4edba; border: 0; border-radius: 0; background: transparent; border-bottom: 1px solid #b2c39a; padding: 3px 0; white-space: nowrap; font-size: 15px; }
.connection-panel { padding: 16px; background: white; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; } .connection-panel > p { font-size: 15px; line-height: 1.6; }
.warning { background: #fbf0e4; border: 1px solid #ecd6b7; padding: 11px 13px; font-size: 14px; color: #895f29; border-radius: 7px; margin-bottom: 12px; line-height: 1.6; }
#qr-box img { width: 220px; height: 220px; object-fit: contain; } #qr-box p { font-size: 15px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #edf2e7; }
.login-card { width: min(450px, 100%); padding: 30px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 80px #183c3010; }
.login-card .brand-mark { margin-bottom: 20px; } .login-card h1 { font-size: 25px; line-height: 1.35; } .login-card p { font-size: 15px; color: #647557; } .login-card label { margin-top: 20px; } .login-card button { width: 100%; margin-top: 5px; } #login-error { color: #a4482f; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 22px; max-width: 490px; width: 94vw; color: #354a2d; box-shadow: 0 15px 70px #15331c33; } dialog::backdrop { background: #173e3080; backdrop-filter: blur(3px); }
dialog p { font-size: 16px; line-height: 1.6; color: #627552; } .dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; } .dialog-heading h2 { font-size: 21px; margin: 0; } #demo-dialog .primary { width: 100%; margin-top: 7px; }
.image-viewer { background: #16241d; color: #edf2e9; width: min(1000px, 96vw); max-width: none; max-height: 96dvh; padding: 0; border: 1px solid #53624f; overflow: auto; }
.image-viewer::backdrop { background: #0b1712de; }
.viewer-header, .viewer-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 10px 16px; font-size: 15px; }
.viewer-header .icon-button { color: white; } .viewer-header .icon-button:hover { background: #344b3a; }
.viewer-stage { display: grid; place-items: center; padding: 0 12px; min-height: 220px; }
.viewer-stage > img { width: 100%; height: min(73dvh, 850px); object-fit: contain; }
.viewer-footer button, .viewer-error button { color: #edf2e9; background: #2c4031; border-color: #51644c; font-size: 15px; }
.viewer-error { text-align: center; } .viewer-error p { color: #e1e6d8; }
@media (max-width: 1050px) {
  th:first-child { width: 45%; } th:nth-child(2) { width: 18%; } th:nth-child(3) { width: 21%; } th:last-child { width: 16%; }
  .page-heading { flex-wrap: wrap; gap: 12px; } .content { padding: 14px 18px 20px; }
  td, th { padding: 13px 11px; } td:first-child, th:first-child { padding-left: 14px; }
}
@media (max-width: 720px) {
  .customer-record { gap: 8px; padding: 13px 10px; flex-wrap: wrap; }
  .customer-record-meta { font-size: 13px; } .customer-record-meta small { font-size: 12px; }
  #customers-page .page-heading .button-row { gap: 7px; } #customers-page .button-row > * { font-size: 14px; padding: 9px; }
  .topbar { padding: 10px 12px; gap: 7px; min-height: 60px; } #today { display: none; }
  .brand { font-size: 13px; gap: 7px; } .brand small { font-size: 12px; } .brand-mark { width: 34px; height: 34px; font-size: 25px; }
  .connection { font-size: 12px; padding: 8px; gap: 4px; } .topbar-actions { gap: 0; } #logout { padding: 7px; }
  .content { padding: 12px 10px 20px; }
  .banner { flex-wrap: wrap; gap: 5px 8px; margin-bottom: 14px; font-size: 12px; padding: 7px 9px; } .banner span { flex: 1; }
  .banner button { font-size: 13px; }
  h1 { font-size: 25px; } .page-heading { gap: 12px; margin-bottom: 12px; }
  .stats { width: 100%; gap: 6px; } .stat { flex: 1; font-size: 13px; padding: 9px 7px; gap: 5px; }
  .stat strong { font-size: 18px; } .stat .dot { display: none; }
  .toolbar { flex-wrap: wrap; padding: 11px 12px; gap: 9px; }
  .tabs { flex: 1; } .tabs button { flex: 1; font-size: 15px; padding: 8px 9px; }
  .toolbar input { order: 3; width: 100%; flex-basis: 100%; }
  .refresh { padding: 4px 7px; }
  table, tbody { display: block; width: 100%; } thead { display: none; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 15px; padding: 14px 12px; border-top: 1px solid var(--line); }
  td { display: block; border: 0; padding: 0; min-width: 0; }
  td:first-child { grid-column: 1 / -1; padding: 0; }
  .received-cell::before, .deadline-cell::before { display: block; font-size: 11px; font-weight: 600; color: #64765a; margin-bottom: 5px; }
  .received-cell::before { content: 'ĐÃ NHẬN'; } .deadline-cell::before { content: 'DEADLINE'; }
  .customer-cell { gap: 9px; } .customer-avatar { width: 32px; height: 32px; }
  .image-thumb { width: 82px; height: 94px; } .row-images { gap: 7px; }
  .action-cell { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .complete-button, .reopen-button { font-size: 15px; padding: 10px 12px; }
  .view-request { font-size: 14px; margin: 0; padding: 9px 2px; }
  .table-footer { padding: 11px 12px; font-size: 12px; flex-wrap: wrap; gap: 5px 10px; }
  .footnote { font-size: 12px; }
  .detail-title { padding: 14px 13px 8px; flex-wrap: wrap; align-items: flex-start; gap: 9px; }
  .detail-title > div { flex: 1; min-width: 160px; } .detail-title h2 { font-size: 22px; }
  .detail-title .customer-avatar { display: none; } .detail-complete { font-size: 14px; padding: 9px; }
  .detail-summary { padding: 0 13px 12px; } .detail-section { padding: 11px 13px 15px; }
  .drawer-header { padding: 8px 13px; }
  .conversation-image { width: min(155px, 100%); height: 185px; }
  .other-options { margin: 0 13px 15px; }
  .image-viewer { width: 100vw; max-height: 100dvh; border-radius: 0; border: 0; }
  .viewer-stage { padding: 0 5px; } .viewer-stage > img { height: 72dvh; }
  .viewer-header, .viewer-footer { padding: 10px 12px; font-size: 14px; }
}
.desktop-import { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 14px 0; background: #fff; }
.desktop-import summary { font-size: 18px; font-weight: 650; cursor: pointer; }
.desktop-import p { margin: 10px 0; line-height: 1.5; overflow-wrap: anywhere; }
.desktop-file-label { display: grid; gap: 6px; margin: 12px 0; }
.desktop-import input { max-width: 100%; width: 100%; box-sizing: border-box; font: inherit; }
.desktop-import input[type=file] { padding: 8px 0; }
.desktop-import progress { width: 100%; height: 18px; accent-color: #285843; }
#desktop-report { background: #f1f6f0; padding: 12px; border-radius: 8px; margin: 12px 0; }
#desktop-key-form { max-width: 460px; margin: 14px 0; }
#desktop-key-form label { display: grid; gap: 6px; }
.desktop-import .button-row { flex-wrap: wrap; }
.group-bot-panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin: 10px 0; padding: 12px 14px; }
.group-bot-panel summary { font-size: 17px; font-weight: 650; cursor: pointer; }
#group-bot-label { color: var(--muted); font-size: 15px; font-weight: 400; margin-left: 8px; }
.group-bot-content { max-width: 850px; }
.group-bot-content p { line-height: 1.5; margin: 10px 0; overflow-wrap: anywhere; }
#group-bot-form { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; }
#group-bot-form label { display: grid; flex: 1 1 250px; gap: 6px; }
#group-bot-token { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; }
.group-bot-panel .button-row { flex-wrap: wrap; }
#group-bot-code { font-size: 20px; font-weight: 700; user-select: all; overflow-wrap: anywhere; }
