/* PosXO Support Desk - three-pane layout (queue | customer | ticket) */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: "Segoe UI", Roboto, Arial, sans-serif; background: #f4f6f9; margin: 0; color: #2c3e50; font-size: 13px; }
a { color: #0f6b6b; }
a:hover { color: #0b5757; }
.muted { color: #7b8a99; }
.small { font-size: 12px; }
.inline { display: inline; margin: 0; }

/* ---- top bar ---- */
.topnav { height: 48px; background: #0f6b6b; color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.topnav .brand { font-size: 16px; font-weight: 700; }
.topnav .brand i { color: #f0c27a; margin-right: 6px; }
.topnav-right { display: flex; align-items: center; gap: 14px; }
.topnav .who small { color: rgba(255,255,255,.7); }
.btn-signout { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-signout:hover { background: rgba(255,255,255,.25); color: #fff; }

#flash .flash { margin: 8px 12px 0; padding: 8px 12px; }

/* ---- desk ---- */
.desk { display: flex; height: calc(100vh - 48px); padding: 10px; gap: 10px; }
.pane { background: #fff; border: 1px solid #e1e5ea; border-radius: 6px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pane-queue { width: 25%; min-width: 280px; }
.pane-pair { flex: 1; display: flex; min-width: 0; }
.pane-pair.loading { opacity: .5; pointer-events: none; }
.pane-customer { width: 32%; min-width: 220px; flex: none; }

/* draggable divider between the customer and ticket panes; it stands in for the 10px gap */
.splitter { flex: none; width: 10px; cursor: col-resize; position: relative; touch-action: none; }
.splitter::after { content: ""; position: absolute; top: 50%; left: 3px; width: 4px; height: 40px; margin-top: -20px; border-radius: 2px; background: #d3d9e0; }
.splitter:hover::after, .splitter.dragging::after { background: #0f6b6b; height: 100%; top: 0; margin-top: 0; }
body.resizing { cursor: col-resize; user-select: none; }
.pane-ticket { flex: 1; min-width: 0; }
.empty-pane { align-items: center; justify-content: center; color: #9aa7b3; text-align: center; padding: 20px; }
.empty-pane i { font-size: 32px; margin-bottom: 8px; }

.pane-head { padding: 10px 12px; border-bottom: 1px solid #eef1f4; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pane-title { font-weight: 600; font-size: 14px; }
.pane-body { padding: 10px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.count { display: inline-block; background: #eef1f4; color: #5b6b7a; border-radius: 9px; padding: 0 7px; font-size: 11px; margin-left: 4px; }
.new-work { background: #e8a33d; color: #fff !important; border-radius: 10px; padding: 2px 8px; font-size: 11px; text-decoration: none; }

/* ---- queue ---- */
.q-tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid #eef1f4; }
.q-tabs a { padding: 5px 8px; font-size: 12px; color: #5b6b7a; text-decoration: none; border-bottom: 2px solid transparent; }
.q-tabs a.on { color: #0f6b6b; border-bottom-color: #0f6b6b; font-weight: 600; }
.q-filter { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid #eef1f4; }
.q-filter input { flex: 1.4; }
.q-filter select { flex: 1; }
.q-list { overflow-y: auto; flex: 1; min-height: 0; }
.q-empty { padding: 30px 12px; text-align: center; color: #7b8a99; }
.q-empty i { color: #2e7d5b; }
.q-day { position: sticky; top: 0; background: #f8fafb; padding: 4px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #7b8a99; border-bottom: 1px solid #eef1f4; z-index: 1; }
.q-row { display: block; padding: 8px 12px; border-bottom: 1px solid #f0f2f5; color: inherit; text-decoration: none !important; border-left: 3px solid transparent; }
.q-row:hover { background: #f6fafa; color: inherit; }
.q-row.selected { background: #e7f3f2; border-left-color: #0f6b6b; }
.q-line1 { display: flex; align-items: center; gap: 6px; }
.q-no { font-weight: 700; color: #0f6b6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-dot { width: 8px; height: 8px; border-radius: 50%; background: #e8a33d; flex: none; }
.q-subject { margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-contact { font-size: 11.5px; color: #5b6b7a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-contact i { color: #9aa7b3; }
.q-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; align-items: center; font-size: 11px; }
.age { color: #5b6b7a; }
.age.overdue { color: #c0392b; font-weight: 700; }
.cat { color: #7b8a99; }
.initials { margin-left: auto; background: #34495e; color: #fff; border-radius: 50%; width: 22px; height: 22px; line-height: 22px; text-align: center; font-size: 10px; font-weight: 700; }

/* ---- pills ---- */
.stat, .prio { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.stat-lg { font-size: 12px; padding: 3px 12px; }
.st-Open { background: #e3f1f0; color: #0f6b6b; }
.st-InProgress { background: #e6effa; color: #2f6fb3; }
.st-AwaitingCustomer { background: #fdf1de; color: #9a6212; }
.st-Resolved { background: #e8f8f0; color: #1e8a54; }
.st-Closed { background: #eef1f4; color: #7b8a99; }
.prio-Low { background: #eef1f4; color: #7b8a99; }
.prio-Normal { background: #eef1f4; color: #5b6b7a; }
.prio-High { background: #fdf1de; color: #b9770e; }
.prio-Urgent { background: #fdeaea; color: #c0392b; }

/* ---- customer pane ---- */
.snap { background: #f8fafb; border: 1px solid #eef1f4; border-radius: 6px; padding: 10px; margin-bottom: 12px; }
.snap-biz { margin-bottom: 4px; }
.snap-contact { margin: 6px 0; line-height: 1.6; word-break: break-all; }
.snap-contact i { color: #9aa7b3; width: 14px; }
.snap-products { width: 100%; margin-top: 6px; border-top: 1px solid #e1e5ea; }
.snap-products td { padding: 5px 4px 3px 0; vertical-align: top; border-bottom: 1px solid #eef1f4; }
.snap-products td.warn { color: #c0392b; font-weight: 600; }
.snap-others { margin-top: 8px; font-size: 12px; }
.snap-others summary { cursor: pointer; color: #5b6b7a; }
.snap-other { padding: 2px 0 0 12px; }
.sub-head { font-weight: 600; margin: 4px 0 6px; font-size: 12px; text-transform: uppercase; color: #7b8a99; }
.h-row { display: block; padding: 7px 8px; border: 1px solid #eef1f4; border-radius: 5px; margin-bottom: 6px; color: inherit; text-decoration: none !important; }
.h-row:hover { background: #f6fafa; color: inherit; }
.h-line1 { display: flex; justify-content: space-between; align-items: center; }
.h-no { font-weight: 700; color: #0f6b6b; }
.h-subject { margin: 2px 0; }

/* ---- ticket pane ---- */
.ticket-head { align-items: flex-start; }
.thread { display: flex; flex-direction: column; gap: 8px; background: #fafbfc; }
.msg { max-width: 88%; border-radius: 8px; padding: 8px 12px; border: 1px solid #e1e5ea; background: #fff; }
.msg-customer { align-self: flex-start; background: #fff; }
.msg-agent { align-self: flex-end; background: #e7f3f2; border-color: #cfe5e3; }
.msg-internal { align-self: flex-end; background: #fff8e6; border: 1px dashed #e8a33d; }
.msg-head { font-size: 11.5px; color: #7b8a99; margin-bottom: 3px; }
.msg-internal .msg-head { color: #9a6212; }
.msg-body { word-wrap: break-word; overflow-wrap: anywhere; line-height: 1.45; }
.msg-event { align-self: center; font-size: 11px; color: #7b8a99; background: #eef1f4; border-radius: 10px; padding: 1px 10px; text-align: center; }
.msg-event.event-internal { background: #f7f1e3; }

.act-form { border-top: 1px solid #e1e5ea; padding: 8px 12px 10px; background: #fff; }
.act-fields { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.act-fields label { font-weight: 600; font-size: 11px; color: #5b6b7a; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 120px; }
.act-fields .assign-me { font-weight: 400; }
.reply-box { border: 1px solid #e1e5ea; border-radius: 6px; padding: 6px 8px; }
.reply-box.internal { background: #fff8e6; border-color: #e8a33d; }
.reply-mode { margin-bottom: 4px; }
.reply-mode .radio-inline { font-size: 12px; }
.reply-box textarea { resize: vertical; }
.reply-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; gap: 8px; }
.btn-primary { background: #0f6b6b; border-color: #0b5757; }
.btn-primary:hover, .btn-primary:focus { background: #0b5757; border-color: #094848; }

/* ---- narrow screens: stack the panes ---- */
@media (max-width: 1000px) {
    .desk, .pane-pair { flex-direction: column; height: auto; }
    .pane-queue, .pane-customer, .pane-ticket { width: 100% !important; min-width: 0; }
    .pane-pair { gap: 10px; }
    .splitter { display: none; }
    .q-list { max-height: 50vh; }
}

/* ---- login ---- */
.login-body { background: #f6f7fb; }
.login-wrap { display: flex; min-height: 100vh; }
.login-brand { flex: 1; background: linear-gradient(150deg, #0f6b6b 0%, #0d5c63 55%, #0a4552 100%); color: #fff; padding: 56px 52px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand .lb-mark { width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; font-size: 24px; }
.login-brand h1 { font-size: 30px; font-weight: 700; line-height: 1.25; margin: 0 0 14px; }
.login-brand p { font-size: 15px; color: rgba(255,255,255,.85); max-width: 420px; line-height: 1.6; }
.login-brand .lb-foot { font-size: 12.5px; color: rgba(255,255,255,.7); }
.login-form-side { width: 460px; max-width: 100%; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 360px; font-size: 14px; }
.login-card h2 { font-size: 24px; font-weight: 700; color: #101828; margin: 0 0 6px; }
.login-card .sub { color: #667085; margin-bottom: 28px; }
.login-card .form-control { height: 42px; border-radius: 8px; }
.btn-login { background: #0f6b6b; color: #fff; width: 100%; border: none; padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 600; }
.btn-login:hover { background: #0b5757; }
@media (max-width: 860px) { .login-brand { display: none; } .login-form-side { width: 100%; } }
