/* ==========================================================================
   SHOP MANAGER APSARA 2027 — TRELLO KANBAN BOARD (LIGHT GREY-WHITE THEME)
   ========================================================================== */

:root {
  /* Tông màu nền xám trắng hiện đại */
  --bg-app: #f1f5f9;
  --bg-board: #e2e8f0;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-sub: #64748b;
  --accent-gold: #d97706;

  /* Nền tảng Themes (Headers đậm + Background cột lợt) */
  --shopee-main: #ee4d2d;
  --shopee-gradient: linear-gradient(135deg, #ff5722 0%, #ee4d2d 100%);
  --shopee-col-bg: #fff5f2;
  --shopee-col-border: #fed7cc;

  --fb-main: #1877f2;
  --fb-gradient: linear-gradient(135deg, #2563eb 0%, #1877f2 100%);
  --fb-col-bg: #f0f6ff;
  --fb-col-border: #bfdbfe;

  --tiktok-main: #000000;
  --tiktok-gradient: linear-gradient(135deg, #18181b 0%, #000000 100%);
  --tiktok-col-bg: #f8fafc;
  --tiktok-col-border: #cbd5e1;

  --lazada-main: #0f146d;
  --lazada-gradient: linear-gradient(135deg, #1037d4 0%, #0f146d 100%);
  --lazada-col-bg: #eff6ff;
  --lazada-col-border: #bfdbfe;

  --other-main: #6366f1;
  --other-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --other-col-bg: #f5f3ff;
  --other-col-border: #ddd6fe;

  --status-online: #16a34a;
  --status-warn: #d97706;
  --status-err: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
}

.trello-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ==========================================================================
   BANNER TRÊN CÙNG: Shop Manager APSARA 2027 (XÁM TRẮNG SANG TRỌNG)
   ========================================================================== */
.trello-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.brand-letter {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
}

.banner-title-group {
  display: flex;
  flex-direction: column;
}

.banner-main-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gold-gradient {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #0f172a;
  background: linear-gradient(135deg, #0f172a 60%, #b45309 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 11px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 2px 8px;
  border-radius: 999px;
}

.banner-sub {
  margin: 3px 0 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.banner-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--text-sub);
  pointer-events: none;
}

.search-box input {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  outline: none;
  width: 220px;
  transition: all 0.2s ease;
}

.search-box input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  width: 260px;
}

.status-pill-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #065f46;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-svg {
  width: 15px;
  height: 15px;
}

.btn-danger {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  border-color: #be123c;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #ffffff;
  color: #334155;
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
}

.spin-on-hover:hover {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   SUB-BAR THỐNG KÊ NHANH
   ========================================================================== */
.board-subbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-item {
  color: var(--text-muted);
}

.stat-item strong {
  color: var(--text-main);
  font-weight: 700;
}

.stat-item.text-success strong {
  color: #15803d;
}

.stat-item.text-warning strong {
  color: #b45309;
}

.stat-separator {
  color: var(--border-color);
}

.board-tips {
  color: var(--text-sub);
  font-size: 12px;
}

.board-tips b {
  color: var(--text-main);
}

/* ==========================================================================
   KANBAN BOARD CONTAINER (KHÔNG ÉP TRANG, SCROLL THOẢI MÁI)
   ========================================================================== */
.trello-board-container {
  flex: 1;
  overflow-x: auto;
  overflow-y: visible;
  padding: 24px;
  background-color: var(--bg-app);
}

.kanban-board {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  min-height: 500px;
}

/* Scrollbar styles */
.trello-board-container::-webkit-scrollbar,
.column-cards-list::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.trello-board-container::-webkit-scrollbar-track,
.column-cards-list::-webkit-scrollbar-track {
  background: rgba(203, 213, 225, 0.4);
}

.trello-board-container::-webkit-scrollbar-thumb,
.column-cards-list::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.trello-board-container::-webkit-scrollbar-thumb:hover,
.column-cards-list::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ==========================================================================
   CỘT NỀN TẢNG (KANBAN COLUMN: TIÊU ĐỀ TÔ MÀU ĐẬM + BODY MÀU LỢT NỀN TẢNG)
   ========================================================================== */
.kanban-column {
  width: 340px;
  min-width: 330px;
  max-width: 360px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kanban-column:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
}

/* CỘT 1: SHOPEE (Tiêu đề Cam Shopee, Thân cột màu Cam lợt) */
.kanban-column[data-platform="shopee"] {
  border: 1px solid var(--shopee-col-border);
}
.kanban-column[data-platform="shopee"] .column-header {
  background: var(--shopee-gradient);
  color: #ffffff;
}
.kanban-column[data-platform="shopee"] .column-cards-list {
  background-color: var(--shopee-col-bg);
}

/* CỘT 2: FACEBOOK (Tiêu đề Xanh FB, Thân cột màu Xanh dương lợt) */
.kanban-column[data-platform="facebook"] {
  border: 1px solid var(--fb-col-border);
}
.kanban-column[data-platform="facebook"] .column-header {
  background: var(--fb-gradient);
  color: #ffffff;
}
.kanban-column[data-platform="facebook"] .column-cards-list {
  background-color: var(--fb-col-bg);
}

/* CỘT 3: TIKTOK (Tiêu đề Nền đen, Logo 3D màu chuẩn TikTok) */
.kanban-column[data-platform="tiktok"] {
  border: 1px solid var(--tiktok-col-border);
}
.kanban-column[data-platform="tiktok"] .column-header {
  background: #000000;
  color: #ffffff;
}
.kanban-column[data-platform="tiktok"] .column-header-icon {
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.kanban-column[data-platform="tiktok"] .column-cards-list {
  background-color: var(--tiktok-col-bg);
}

/* CỘT 4: LAZADA (Tiêu đề Nền xanh Lazada, Logo trái tim 3D đỏ/cam) */
.kanban-column[data-platform="lazada"] {
  border: 1px solid var(--lazada-col-border);
}
.kanban-column[data-platform="lazada"] .column-header {
  background: var(--lazada-gradient);
  color: #ffffff;
}
.kanban-column[data-platform="lazada"] .column-header-icon {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.kanban-column[data-platform="lazada"] .column-cards-list {
  background-color: var(--lazada-col-bg);
}

/* CỘT KHÁC (FALLBACK NỀN TẢNG MỚI TỰ ĐỘNG THÊM) */
.kanban-column[data-platform="other"] {
  border: 1px solid var(--other-col-border);
}
.kanban-column[data-platform="other"] .column-header {
  background: var(--other-gradient);
  color: #ffffff;
}
.kanban-column[data-platform="other"] .column-cards-list {
  background-color: var(--other-col-bg);
}

/* HEADER TIÊU ĐỀ TỪNG CỘT */
.column-header {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.column-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.column-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  flex-shrink: 0;
}

.column-header-icon svg {
  width: 17px;
  height: 17px;
}

.column-title-text {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.column-badge-count {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* DANH SÁCH THẺ BÊN TRONG CỘT (CUỘN RIÊNG TỪNG CỘT NẾU QUÁ DÀI) */
.column-cards-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  min-height: 150px;
}

/* ==========================================================================
   THẺ SHOP (TRELLO CARD NỀN TRẮNG SÁNG RÕ NÉT)
   ========================================================================== */
.shop-trello-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.18s ease;
  position: relative;
}

.shop-trello-card:hover {
  background: var(--bg-card-hover);
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.shop-trello-card.is-disabled {
  opacity: 0.65;
  background: #f8fafc;
}

/* Card Header */
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-shop-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.card-shop-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f1f5f9;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.card-shop-avatar-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: #334155;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}

.card-shop-names {
  min-width: 0;
}

.card-shop-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.card-shop-id {
  font-size: 11.5px;
  color: var(--text-sub);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.card-shop-id code {
  color: #2563eb;
  background: #eff6ff;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #dbeafe;
}

/* Status Pill */
.card-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

.card-status-pill.status-online {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.card-status-pill.status-check {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.card-status-pill.status-disabled {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Card Metrics snippet (Orders Today & Unread Messages) */
.card-metrics-row {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 8px;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 11.5px;
  min-height: 48px;
  align-items: center;
}

.metric-col {
  display: flex;
  flex-direction: column;
}

.metric-label {
  color: var(--text-sub);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.metric-val {
  color: #0f172a;
  font-weight: 700;
  font-size: 12px;
}

.orders-display-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.orders-main-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.orders-main-num {
  font-size: 12.5px;
  font-weight: 800;
  color: #0f172a;
}

.orders-main-num.orders-zero {
  color: #64748b;
  font-weight: 600;
}

.orders-breakdown-sub {
  font-size: 9.5px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
}

.badge-instant-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  border: 1px solid #fecaca;
  white-space: nowrap;
}

.badge-unread-alert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef2f2;
  color: #dc2626;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  width: fit-content;
}

.badge-unread-none {
  color: #64748b;
  font-size: 11.5px;
  font-weight: 600;
}

.unread-dot {
  width: 6px;
  height: 6px;
  background-color: #ef4444;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Card Action Footer */
.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.btn-card-check {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-card-check:hover:not(:disabled) {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-card-check:disabled {
  opacity: 0.6;
  cursor: wait;
}

.card-toggle-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 16px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s;
  border-radius: 16px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(12px);
}

/* Empty column state */
.column-empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-sub);
  font-size: 12.5px;
  border: 1px dashed rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  margin: 8px;
}

/* Board Loading */
.kanban-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 300px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #cbd5e1;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

/* ========================================================
   MODAL KIỂM TRA KẾT NỐI SHOP (CHUẨN GIAO DIỆN SM 2027)
   ======================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none !important;
}

.conn-modal-dialog {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.conn-header-spacer {
  width: 28px;
}

.conn-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  flex: 1;
}

.btn-modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-modal-close:hover {
  background: #fee2e2;
  color: #dc2626;
}

.conn-modal-body {
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}

.conn-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.conn-stat-counters {
  display: flex;
  align-items: center;
  gap: 24px;
}

.conn-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.conn-stat-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.conn-stat-num.num-total {
  color: #0f172a;
}

.conn-stat-num.num-connected {
  color: #16a34a;
}

.conn-stat-num.num-disconnected {
  color: #dc2626;
}

.conn-stat-label {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
  font-weight: 500;
}

.conn-stat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-conn-circle {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-conn-circle:hover {
  color: #2563eb;
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn-conn-primary {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-conn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-conn-primary:disabled,
.btn-conn-warning:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-conn-warning {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #f59e0b;
  background: #f59e0b;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-conn-warning:hover:not(:disabled) {
  background: #d97706;
}

/* Platform Breakdown Cards */
.conn-platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.conn-platform-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.conn-platform-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.conn-platform-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.conn-platform-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.conn-platform-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}

.conn-platform-badge-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.conn-platform-badge-icon svg {
  width: 16px;
  height: 16px;
}

.conn-platform-total {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.conn-platform-bar {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.conn-platform-bar-fill {
  height: 100%;
  background: #16a34a;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.conn-platform-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.conn-platform-ok {
  color: #16a34a;
  font-weight: 600;
}

.conn-platform-err {
  color: #dc2626;
  font-weight: 600;
}

/* Search Row */
.conn-search-row {
  position: relative;
  display: flex;
  align-items: center;
}

.conn-search-icon {
  position: absolute;
  left: 12px;
  font-size: 13px;
  color: #94a3b8;
  pointer-events: none;
}

.conn-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: all 0.15s ease;
}

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

/* Shop Connection Table */
.conn-table-wrap {
  max-height: 380px;
  min-height: 220px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.conn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.conn-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid #e2e8f0;
  z-index: 2;
}

.conn-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}

.conn-table tbody tr:hover {
  background: #f8fafc;
}

.conn-table td {
  padding: 10px 10px;
  vertical-align: middle;
}

.conn-table .col-dot {
  width: 24px;
  text-align: center;
}

.conn-table .col-avatar {
  width: 40px;
}

.conn-table .col-name {
  min-width: 170px;
}

.conn-table .col-seller {
  width: 140px;
  color: #475569;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.conn-table .col-status {
  width: 220px;
}

.conn-row-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.conn-row-dot.dot-ok {
  background: #16a34a;
}

.conn-row-dot.dot-err {
  background: #dc2626;
}

.conn-row-dot.dot-loading {
  background: #2563eb;
  animation: pulse-dot 1s infinite;
}

.conn-row-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
}

.conn-row-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.conn-row-shop-name {
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.conn-row-shop-platform {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
  text-transform: capitalize;
}

.conn-status-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.conn-status-ok {
  color: #16a34a;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conn-status-err {
  color: #dc2626;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conn-status-loading {
  color: #2563eb;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-conn-row-action {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-conn-row-toggle {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-conn-row-toggle:hover {
  background: #e2e8f0;
}

.btn-conn-row-reconnect {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.btn-conn-row-reconnect:hover {
  background: #fee2e2;
}
