* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #1c1e21;
}

h1:focus {
    outline: none;
}

/* ===== Layout inbox 2 cột ===== */
.inbox {
    display: flex;
    height: 100vh;
}

.conversation-list {
    width: 340px;
    min-width: 280px;
    background: #fff;
    border-right: 1px solid #e4e6eb;
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e4e6eb;
}

.list-header h1 {
    font-size: 1.3rem;
    margin: 0;
    color: #0068ff;
}

.header-links {
    display: flex;
    gap: 12px;
}

.simulator-link {
    font-size: 0.85rem;
    color: #65676b;
    text-decoration: none;
}

.simulator-link:hover {
    color: #0068ff;
}

/* Bộ lọc kênh */
.channel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #e4e6eb;
}

.filter {
    border: 1px solid #d0d2d7;
    background: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    color: #444;
}

.filter.active {
    background: #0068ff;
    border-color: #0068ff;
    color: #fff;
}

.empty-list {
    padding: 24px 16px;
    color: #65676b;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Danh sách hội thoại */
.items {
    overflow-y: auto;
    flex: 1;
}

.item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

.item:hover {
    background: #f5f6f7;
}

.item.selected {
    background: #e7f0ff;
}

.channel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.item-body {
    flex: 1;
    min-width: 0;
}

.item-top, .item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time {
    font-size: 0.75rem;
    color: #8a8d91;
    flex-shrink: 0;
}

.preview {
    font-size: 0.85rem;
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread {
    background: #e41e3f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    flex-shrink: 0;
}

/* Thanh nhân viên hiện tại */
.me-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid #e4e6eb;
    font-size: 0.85rem;
    background: #f7f8fa;
}

.me-name {
    font-weight: 600;
    color: #1c1e21;
}

.me-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.me-links a {
    text-decoration: none;
    color: #65676b;
}

.logout-link {
    color: #b3261e !important;
}

/* Avatar khách trong danh sách + panel */
.item-avatar {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.item-avatar img,
.avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.item-avatar .channel-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
}

.item-assignee {
    font-size: 0.72rem;
    color: #0053cc;
    margin-top: 2px;
}

.panel-avatar {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.panel-avatar img,
.panel-avatar .avatar-fallback {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    font-size: 1.6rem;
}

.panel-assignee {
    width: 100%;
    font-size: 0.85rem;
    color: #65676b;
    margin-top: 4px;
}

.panel-assignee .muted {
    color: #8a8d91;
    font-style: italic;
}

/* Dropdown phân công */
.assign-select {
    border: 1px solid #d0d2d7;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* Thanh nút nhanh: AI + câu trả lời mẫu */
.quick-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 18px 0;
    background: #fff;
}

.ai-chip {
    border: 1px solid #d4820a;
    background: #fff7ec;
    color: #b8690a;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.ai-chip:disabled {
    opacity: 0.6;
    cursor: default;
}

.quick-chip {
    border: 1px solid #d0d2d7;
    background: #fff;
    color: #444;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-chip:hover {
    background: #f0f2f5;
}

.ai-error {
    color: #b3261e;
    font-size: 0.78rem;
}

/* Trang cấu hình: nhân viên + câu mẫu */
.full-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 12px;
}

.full-field textarea {
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 400;
    resize: vertical;
}

.checkbox-field {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
}

.sub-head {
    margin: 16px 0 8px;
    font-size: 0.95rem;
}

.staff-list, .quick-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.staff-row, .quick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    font-size: 0.88rem;
}

.staff-username {
    color: #8a8d91;
    font-weight: 400;
}

.staff-badge {
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 1px 8px;
}

.staff-badge.admin { background: #ede9fe; color: #5b21b6; }
.staff-badge.off { background: #fdecea; color: #b3261e; }

.staff-actions {
    margin-left: auto;
}

.staff-actions button, .quick-del {
    border: 1px solid #d0d2d7;
    background: #fff;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.quick-title {
    font-weight: 600;
    flex-shrink: 0;
}

.quick-content {
    color: #65676b;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-del {
    margin-left: auto;
    color: #b3261e;
}

/* Nhật ký webhook */
.webhook-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    max-height: 340px;
    overflow-y: auto;
}

.webhook-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
    background: #f7f8fa;
    border-left: 3px solid #d0d2d7;
}

.webhook-row.ok { border-left-color: #1a7f37; }
.webhook-row.warn { border-left-color: #b8690a; }
.webhook-row.fail { border-left-color: #b3261e; background: #fdecea; }

.wh-time { color: #8a8d91; white-space: nowrap; }
.wh-channel { font-weight: 600; white-space: nowrap; }
.wh-status { white-space: nowrap; }

.wh-detail {
    color: #65676b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Kết quả kiểm tra kết nối kênh */
.test-result {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.5;
}

.test-result.ok {
    background: #e6f4ea;
    color: #1a7f37;
    border: 1px solid #b7e1c3;
}

.test-result.fail {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}

/* Mã QR đăng nhập Zalo cá nhân */
.qr-box {
    margin-top: 14px;
    padding: 16px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    text-align: center;
}

.qr-img {
    width: 240px;
    height: 240px;
    image-rendering: pixelated;
    background: #fff;
    padding: 8px;
    border-radius: 8px;
}

/* Trợ lý AI: chọn nhà cung cấp */
.provider-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.provider-tab {
    border: 1px solid #d0d2d7;
    background: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: #444;
}

.provider-tab.active {
    background: #d4820a;
    border-color: #d4820a;
    color: #fff;
}

.guide-inner {
    margin-top: 8px;
    font-size: 0.86rem;
    line-height: 1.6;
    color: #3a3b3c;
}

.guide-inner code {
    background: #eceef1;
    border-radius: 4px;
    padding: 1px 5px;
}

/* Trợ lý AI: FAQ + ảnh tư liệu */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
}

.faq-body {
    flex: 1;
    min-width: 0;
}

.faq-q {
    font-weight: 600;
    font-size: 0.88rem;
}

.faq-a {
    font-size: 0.85rem;
    color: #444;
    margin-top: 3px;
}

.ai-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.ai-image-card {
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.ai-image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.ai-image-caption {
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #444;
    flex: 1;
}

.ai-image-card .quick-del {
    margin: 0 8px 8px;
    color: #b3261e;
}

.upload-label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.upload-label input[type="file"] {
    display: none;
}

/* Trang đăng nhập */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f0f2f5;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 32px 36px;
    width: min(380px, 92vw);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card h1 {
    margin: 0;
    text-align: center;
    color: #0068ff;
}

.login-sub {
    text-align: center;
    color: #65676b;
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.login-card label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.login-card input {
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
}

.login-card button {
    background: #0068ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 4px;
}

.login-error {
    background: #fdecea;
    color: #b3261e;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.86rem;
}

.login-hint {
    text-align: center;
    color: #8a8d91;
    font-size: 0.8rem;
    margin: 4px 0 0;
}

/* Thẻ trạng thái hội thoại */
.tag {
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.tag-blue { background: #e7f0ff; color: #0053cc; }
.tag-orange { background: #fff3e0; color: #b25e00; }
.tag-green { background: #e6f4ea; color: #1a7f37; }
.tag-gray { background: #f0f2f5; color: #65676b; }
.tag-red { background: #fef2f2; color: #dc2626; border: 1px solid #fca5a5; font-weight: 700; }

.tag-select {
    border: 1px solid #d0d2d7;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

.tag-select.tag-blue { background: #e7f0ff; color: #0053cc; border-color: #b3d1ff; }
.tag-select.tag-orange { background: #fff3e0; color: #b25e00; border-color: #ffd699; }
.tag-select.tag-green { background: #e6f4ea; color: #1a7f37; border-color: #b7e1c3; }
.tag-select.tag-gray { background: #f0f2f5; color: #65676b; border-color: #d0d2d7; }
.tag-select.tag-red { background: #fef2f2; color: #dc2626; border-color: #fca5a5; font-weight: 700; }

.trello-btn {
    border: 1px solid #0079bf;
    background: #fff;
    color: #0079bf;
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.trello-btn:hover {
    background: #e7f3f9;
}

.trello-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.trello-note {
    font-size: 0.8rem;
    color: #1a7f37;
}

.trello-note a {
    color: #0079bf;
}

.trello-note.error {
    color: #b3261e;
}

/* Màu nhận diện từng kênh */
.ch-zalo { background: #0068ff; }
.ch-zalopersonal { background: #00a5b8; }
.ch-messenger { background: #a334fa; }
.ch-shopee { background: #ee4d2d; }
.ch-tiktok { background: #161823; }
.ch-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.ch-threads { background: #000000; }
.ch-googlelocation { background: #4285F4; }

/* ===== Khung chat ===== */
.chat-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.no-selection {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8d91;
    font-size: 1.05rem;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
}

.channel-badge {
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 3px 8px;
}

.chat-name {
    font-weight: 600;
    font-size: 1.05rem;
}

/* ===== COMPACT UNIFORM INBOX HEADER SELECTS ===== */
.inbox-header-select {
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    max-width: 175px;
}

.inbox-header-select:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.inbox-header-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.inbox-header-select.ai-agent-select {
    border-color: #d8b4fe;
    background-color: #faf5ff;
    color: #7e22ce;
}

.inbox-header-select.ai-mode-select.autopilot {
    border-color: #86efac;
    background-color: #f0fdf4;
    color: #15803d;
}

.inbox-header-select.ai-mode-select.suggestion {
    border-color: #fde68a;
    background-color: #fffbeb;
    color: #b45309;
}

.inbox-header-select.ai-mode-select.disabled {
    border-color: #fca5a5;
    background-color: #fef2f2;
    color: #b91c1c;
}

.not-configured {
    margin-left: auto;
    font-size: 0.78rem;
    color: #b8860b;
    background: #fff8e1;
    border: 1px solid #f0e0a0;
    border-radius: 4px;
    padding: 3px 8px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative; /* Cho button định vị absolute (nếu cần) */
}

/* Nút cuộn xuống cuối */
.scroll-to-bottom-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0068ff;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-opacity: 0.9;
    transition: transform 0.2s, background 0.2s;
    z-index: 10;
}

.scroll-to-bottom-btn:hover {
    background: #0053cc;
    transform: scale(1.05);
}

.bubble-row {
    display: flex;
}

.bubble-row.out {
    justify-content: flex-end;
}

.bubble {
    max-width: 65%;
    background: #fff;
    border-radius: 16px;
    padding: 9px 13px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.bubble-row.out .bubble {
    background: #0068ff;
    color: #fff;
}

.bubble-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.94rem;
    line-height: 1.4;
}

.bubble-meta {
    font-size: 0.7rem;
    margin-top: 4px;
    opacity: 0.7;
    display: flex;
    gap: 8px;
}

.status.failed {
    color: #ffd0d0;
    font-weight: 600;
}

.bubble-row.in .status.failed {
    color: #e41e3f;
}

.status.simulated {
    font-style: italic;
}

.bubble-file {
    display: inline-block;
    color: inherit;
    text-decoration: underline;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.rule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rule-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
}

.rule-row.off {
    opacity: 0.6;
}

.rule-body {
    flex: 1;
    min-width: 0;
}

.rule-name {
    font-weight: 600;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rule-kw {
    font-size: 0.82rem;
    color: #65676b;
    margin-top: 2px;
}

.rule-file {
    font-size: 0.82rem;
    margin-top: 3px;
}

.rule-file a {
    color: #0079bf;
}

.rule-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rule-actions button {
    border: 1px solid #d0d2d7;
    background: #fff;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 0.8rem;
    cursor: pointer;
}

.bubble-error {
    margin-top: 4px;
    font-size: 0.72rem;
    color: #ffe0e0;
    background: rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    padding: 4px 7px;
    word-break: break-word;
}

.bubble-img {
    max-width: 240px;
    max-height: 240px;
    border-radius: 10px;
    display: block;
    margin-bottom: 4px;
}

/* ===== Cột phải: khách hàng + tạo đơn hàng ===== */
.customer-panel {
    width: 320px;
    min-width: 280px;
    background: #fff;
    border-left: 1px solid #e4e6eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Tab bar */
.panel-tabs {
    display: flex;
    border-bottom: 2px solid #e4e6eb;
    flex-shrink: 0;
}

.panel-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    color: #65676b;
    font-family: inherit;
    position: relative;
    transition: color 0.15s;
}

.panel-tab:hover {
    color: #1c1e21;
    background: #f7f8fa;
}

.panel-tab.active {
    color: #0068ff;
}

.panel-tab.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #0068ff;
}

.panel-tab.tab-order.active {
    color: #e04d01;
}

.panel-tab.tab-order.active::after {
    background: #e04d01;
}

/* Giữ nguyên panel section cũ */
.panel-section {
    padding: 16px 18px;
    border-bottom: 1px solid #f0f2f5;
    overflow-y: auto;
}

.panel-section h3 {
    margin: 0 0 10px;
    font-size: 0.88rem;
    color: #65676b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.panel-customer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.panel-name {
    font-weight: 700;
    font-size: 1.02rem;
    width: 100%;
}

.order-count {
    background: #e7f0ff;
    color: #0053cc;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 0.75rem;
}

.panel-empty {
    color: #8a8d91;
    font-size: 0.84rem;
    line-height: 1.5;
    margin: 0;
}

.orders-section {
    flex: 1;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    padding: 10px 12px;
}

.order-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.order-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.order-amount {
    color: #1a7f37;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
}

.order-meta {
    font-size: 0.76rem;
    color: #8a8d91;
    margin-top: 3px;
    display: flex;
    gap: 10px;
}

.order-meta a {
    color: #0079bf;
    text-decoration: none;
}

.order-note {
    font-size: 0.82rem;
    color: #444;
    margin-top: 4px;
}

.order-items-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 5px;
}

.order-item-line {
    font-size: 0.78rem;
    background: #e7f0ff;
    color: #0053cc;
    border-radius: 4px;
    padding: 1px 6px;
}

/* ===== Form tạo đơn ===== */
.order-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.order-form-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
}

.form-section {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
}

.form-section h3 {
    margin: 0 0 10px;
    font-size: 0.86rem;
    color: #3a3b3c;
    font-weight: 700;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-input {
    width: 100%;
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.86rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #0068ff;
    box-shadow: 0 0 0 2px rgba(0, 104, 255, 0.12);
}

.form-textarea {
    resize: vertical;
    min-height: 44px;
    margin-top: 10px;
}

.customer-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.customer-tag {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1c1e21;
}

.channel-badge.sm {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* Bảng sản phẩm */
.product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.product-table th {
    text-align: left;
    padding: 6px 4px;
    font-weight: 600;
    color: #65676b;
    font-size: 0.75rem;
    border-bottom: 1px solid #e4e6eb;
}

.product-table td {
    padding: 7px 4px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.cell-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.cell-price, .cell-total {
    white-space: nowrap;
    text-align: right;
    font-size: 0.78rem;
}

.cell-total {
    font-weight: 600;
    color: #0053cc;
}

.qty-input {
    width: 42px;
    border: 1px solid #d0d2d7;
    border-radius: 4px;
    padding: 3px 4px;
    text-align: center;
    font-size: 0.82rem;
    font-family: inherit;
}

.qty-input:focus {
    outline: none;
    border-color: #0068ff;
}

.remove-item {
    border: none;
    background: none;
    color: #b3261e;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
}

.remove-item:hover {
    background: #fdecea;
}

/* Trạng thái trống */
.empty-products {
    text-align: center;
    padding: 20px 10px;
    color: #8a8d91;
}

.empty-icon {
    font-size: 2.2rem;
    opacity: 0.5;
    margin-bottom: 4px;
}

.empty-products p {
    margin: 4px 0 0;
    font-size: 0.84rem;
}

/* Ô tìm kiếm sản phẩm */
.product-search-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.product-search-bar .form-input {
    flex: 1;
}

.btn-add-inline {
    width: 36px;
    height: 36px;
    border: 1px solid #0068ff;
    background: #0068ff;
    color: #fff;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.btn-add-inline:hover {
    background: #0053cc;
}

/* Dropdown kết quả tìm kiếm */
.product-dropdown {
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 160px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.product-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.84rem;
    transition: background 0.1s;
}

.product-option:hover {
    background: #e7f0ff;
}

.product-option.no-result {
    color: #8a8d91;
    cursor: default;
    justify-content: center;
}

.product-option.no-result:hover {
    background: transparent;
}

.product-opt-price {
    color: #1a7f37;
    font-weight: 600;
    white-space: nowrap;
}

/* Form thêm sản phẩm mới (inline) */
.add-product-inline {
    margin-top: 8px;
    padding: 10px;
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.add-product-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.btn-small-save {
    background: #0068ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.btn-small-save:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-small-cancel {
    background: #e4e6eb;
    color: #1c1e21;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

/* Tóm tắt thanh toán */
.order-summary {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 0.84rem;
    border-bottom: 1px solid #f0f2f5;
}

.summary-value {
    font-weight: 600;
    color: #1c1e21;
    white-space: nowrap;
}

.summary-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #65676b;
}

.summary-input {
    width: 80px;
    border: 1px solid #d0d2d7;
    border-radius: 6px;
    padding: 4px 6px;
    text-align: right;
    font-size: 0.82rem;
    font-family: inherit;
}

.summary-input:focus {
    outline: none;
    border-color: #0068ff;
}

.total-row {
    border-bottom: none;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 2px solid #e4e6eb;
}

.summary-grand-total {
    font-weight: 700;
    font-size: 1rem;
    color: #e04d01;
}

/* Thông báo */
.order-form-msg {
    padding: 8px 16px;
    font-size: 0.84rem;
    flex-shrink: 0;
}

.order-form-msg.error {
    background: #fdecea;
    color: #b3261e;
}

.order-form-msg.success {
    background: #e6f4ea;
    color: #1a7f37;
}

/* Bottom bar */
.order-form-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e4e6eb;
    background: #fff;
    flex-shrink: 0;
}

.btn-reset {
    flex: 1;
    background: #fff;
    color: #65676b;
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-reset:hover {
    background: #f0f2f5;
}

.btn-reset:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-create-order {
    flex: 1.2;
    background: #e04d01;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.btn-create-order:hover {
    background: #c74400;
}

.btn-create-order:disabled {
    background: #f0a880;
    cursor: default;
}

/* ===== Popup xem trước thẻ Trello ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: #fff;
    border-radius: 14px;
    padding: 22px 26px;
    width: min(560px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.modal h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
}

.modal-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
    font-size: 0.86rem;
    margin-bottom: 12px;
}

.modal-label input,
.modal-label textarea {
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 400;
    resize: vertical;
}

.modal-error {
    color: #b3261e;
    font-size: 0.86rem;
    background: #fdecea;
    border-radius: 8px;
    padding: 8px 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.modal-cancel {
    background: #e4e6eb;
    color: #1c1e21;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.modal-create {
    background: #0079bf;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.modal-create:disabled, .modal-cancel:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Nút đính kèm ảnh */
.attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 52px;
    font-size: 1.25rem;
    cursor: pointer;
    border: 1px solid #d0d2d7;
    border-radius: 10px;
    background: #fff;
    flex-shrink: 0;
}

.attach-btn:hover {
    background: #f0f2f5;
}

.attach-btn input[type="file"] {
    display: none;
}

/* Ô soạn tin */
.composer {
    display: flex;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border-top: 1px solid #e4e6eb;
}

.composer textarea {
    flex: 1;
    resize: none;
    height: 52px;
    border: 1px solid #d0d2d7;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.94rem;
}

.composer textarea:focus {
    outline: 2px solid #0068ff;
    border-color: transparent;
}

.composer button {
    background: #0068ff;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0 22px;
    font-weight: 600;
    cursor: pointer;
}

.composer button:disabled {
    background: #a8c6f5;
    cursor: default;
}

/* ===== Trang giả lập ===== */
.simulator {
    max-width: 560px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.simulator h1 {
    margin-top: 0;
    font-size: 1.4rem;
}

.simulator .hint {
    color: #65676b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sim-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.sim-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.sim-form input, .sim-form select, .sim-form textarea {
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 400;
}

.sim-form textarea {
    min-height: 80px;
    resize: vertical;
}

.sim-form button {
    background: #0068ff;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}

.sim-form button:disabled {
    background: #a8c6f5;
    cursor: default;
}

.sent-note {
    color: #1a7f37;
    font-size: 0.9rem;
    margin: 0;
}

/* ===== Trang cấu hình kênh ===== */
.settings {
    max-width: 720px;
    margin: 32px auto;
    padding: 0 16px 48px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h1 {
    font-size: 1.45rem;
}

.settings-header a {
    color: #0068ff;
    text-decoration: none;
    font-size: 0.92rem;
}

.settings-hint {
    color: #65676b;
    font-size: 0.9rem;
    line-height: 1.55;
}

.banner {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.92rem;
    margin-bottom: 14px;
}

.banner-ok {
    background: #e6f4ea;
    color: #1a7f37;
    border: 1px solid #b7e1c3;
}

.banner-error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}

.channel-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.channel-card header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.channel-card h2 {
    font-size: 1.08rem;
    margin: 0;
}

.status-badge {
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 3px 10px;
    margin-left: auto;
}

.status-badge.connected {
    background: #e6f4ea;
    color: #1a7f37;
}

.status-badge.connected em {
    font-style: normal;
    opacity: 0.75;
}

.status-badge.disconnected {
    background: #f0f2f5;
    color: #65676b;
}

.warning-box {
    background: #fdecea;
    border: 1px solid #f5c6c2;
    color: #8c1d18;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.86rem;
    line-height: 1.55;
    margin-bottom: 14px;
}

.guide {
    background: #f7f8fa;
    border: 1px solid #e4e6eb;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 14px;
    font-size: 0.86rem;
}

.guide summary {
    cursor: pointer;
    font-weight: 600;
    color: #0068ff;
    user-select: none;
}

.guide ol {
    margin: 10px 0 4px;
    padding-left: 20px;
    line-height: 1.65;
    color: #3a3b3c;
}

.guide li {
    margin-bottom: 4px;
}

.guide a {
    color: #0068ff;
}

.guide code {
    background: #eceef1;
    border-radius: 4px;
    padding: 1px 5px;
}

.channel-card .fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.channel-card .fields label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
}

.channel-card .fields input {
    border: 1px solid #d0d2d7;
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: inherit;
}

.channel-card .urls {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #65676b;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.channel-card .urls code {
    background: #f0f2f5;
    border-radius: 4px;
    padding: 2px 7px;
    user-select: all;
    color: #1c1e21;
}

.channel-card .actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.btn-save, .btn-connect, .btn-disconnect, .btn-sync {
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.btn-save {
    background: #e4e6eb;
    color: #1c1e21;
}

.btn-connect {
    background: #0068ff;
    color: #fff;
    display: inline-flex;
    align-items: center;
}

.btn-disconnect {
    background: #fff;
    color: #b3261e;
    border: 1px solid #f5c6c2;
}

.btn-sync {
    background: #fff;
    color: #0068ff;
    border: 1px solid #0068ff;
}

.btn-sync:disabled {
    opacity: 0.6;
    cursor: default;
}

.settings-note {
    color: #8a6d1a;
    background: #fff8e1;
    border: 1px solid #f0e0a0;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.86rem;
    line-height: 1.5;
}

/* ===== Mặc định của template ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #b32121;
    color: #fff;
    padding: 0.7rem 1rem;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: #fff;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* ===== Hide mobile buttons by default on desktop ===== */
.mobile-back-btn, .mobile-info-btn, .mobile-close-drawer-btn {
    display: none;
}

/* ===== Mobile Responsive Styles ===== */
@media (max-width: 768px) {
    .inbox {
        flex-direction: row; /* Keep horizontal to allow sliding drawer */
        position: relative;
        overflow: hidden;
        width: 100vw;
        height: 100vh;
    }

    /* Column 1: Conversation List */
    .conversation-list {
        width: 100%;
        min-width: 100%;
        border-right: none;
        display: flex;
        flex-direction: column;
    }
    
    /* Hide conversation list when chatting */
    .inbox.has-selection .conversation-list {
        display: none;
    }

    /* Column 2: Chat Pane */
    .chat-pane {
        display: none;
        width: 100%;
        min-width: 100%;
    }
    
    .inbox.has-selection .chat-pane {
        display: flex;
        flex-direction: column;
    }

    /* Chat Header Adjustment */
    .chat-header {
        padding: 8px 12px;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }

    .chat-header .chat-name {
        flex: 1;
        font-size: 1.02rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide unnecessary items in chat header on mobile */
    .chat-header .tag-select,
    .chat-header .assign-select,
    .chat-header .trello-btn,
    .chat-header .not-configured {
        display: none !important;
    }

    /* Mobile Navigation Buttons */
    .mobile-back-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.25rem;
        padding: 6px 10px;
        cursor: pointer;
        color: #1c1e21;
    }

    .mobile-info-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f0f2f5;
        border: 1px solid #d0d2d7;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        cursor: pointer;
        color: #1c1e21;
        transition: background 0.15s;
    }

    .mobile-info-btn:hover {
        background: #e4e6eb;
    }

    /* Column 3: Customer Panel (Drawer) */
    .customer-panel {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        z-index: 200;
        border-left: none;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

    .inbox.show-info-drawer .customer-panel {
        transform: translateX(0);
    }

    .mobile-close-drawer-btn {
        display: block;
        width: 100%;
        padding: 12px;
        background: #fdecea;
        color: #b3261e;
        border: none;
        font-weight: 700;
        font-size: 0.9rem;
        cursor: pointer;
        text-align: center;
        border-bottom: 1px solid #e4e6eb;
    }

    /* UI components on mobile */
    .composer textarea {
        font-size: 16px; /* Avoid automatic zoom on iOS */
    }

    /* Quick replies scrollable horizontal bar on mobile */
    .quick-bar {
        overflow-x: auto;
        white-space: nowrap;
        padding: 6px 12px;
        display: flex;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .quick-chip, .ai-chip {
        display: inline-block;
        flex-shrink: 0;
    }
}

/* ===== Web Push UI Elements ===== */
.push-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: transform 0.2s, opacity 0.2s;
}

.push-toggle-btn:hover {
    transform: scale(1.15);
}

.push-toggle-btn:active {
    opacity: 0.7;
}

.push-error-bar {
    font-size: 0.72rem;
    color: #b3261e;
    background: #fdecea;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 4px 10px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== SETTINGS PAGE REDESIGN ===== */
.settings-page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f4f6f8;
}

.dashboard-mode {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.settings-tabs {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #0f172a;
}

.tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.dashboard-toolbar .search-box input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 13px;
    width: 260px;
}

.btn-add-connection {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.connected-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.empty-channels {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    color: #64748b;
}

.empty-channels .empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.connected-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.connected-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: 700;
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-actions .btn-icon {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #475569;
    transition: background 0.2s;
}

.card-actions .btn-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modal Kênh */
.pancake-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pancake-modal {
    background: white;
    border-radius: 16px;
    width: 800px;
    max-width: 95vw;
    height: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.pancake-modal .modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pancake-modal .modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.pancake-modal .btn-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #64748b;
    cursor: pointer;
}

.pancake-modal .modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.modal-sidebar {
    width: 220px;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
    overflow-y: auto;
}

.platform-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.platform-list li {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.platform-list li:hover {
    background: #f1f5f9;
}

.platform-list li.active {
    background: white;
    color: #2563eb;
    border-left: 3px solid #2563eb;
}

.platform-list .p-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.pancake-modal .modal-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    background: white;
}

.platform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.platform-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

/* Modal Thành viên (Botcake) */
.botcake-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.botcake-modal-card {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.botcake-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.botcake-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.botcake-modal-footer {
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary-gradient {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.btn-primary-gradient:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}
