.my-sites-table {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  /* overflow: hidden; */
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
  color: #334155;
}

.my-sites-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgb(15 24 39);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  margin-bottom: 12px;
}

.my-sites-toolbar .toolbar-spacer {
  flex: 1;
}

/* View dropdown */
.view-dropdown {
  position: relative;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  font-weight: 600;
  color: #0f172a;
}

.view-btn .view-icon {
  font-size: 14px;
}

.view-btn .caret {
  color: #9ca3af;
}

.view-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  padding: 6px;
  min-width: 180px;
  z-index: 40;
}

.view-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #0f172a;
  text-decoration: none;
}

.view-item:hover {
  background: #f3f4f6;
}

/* Compact top-right action buttons near the table */
.btn-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-compact .btn-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-dark {
  background: #37b34a;
  color: #fff !important;
  border-color: #111827;
}

.btn-dark:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: #f8fafc;
  color: #0f172a !important;
  border-color: #e5e7eb;
}

.btn-ghost:hover {
  background: #eef2ff;
}

.my-sites-table .mst-header {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 0.7fr;
  gap: 0;
  background: #f9fafb;
  color: black;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 14px 14px 0px 0px;
}

.my-sites-table .mst-row {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 0.7fr;
  gap: 0;
  padding: 20px 18px;
  margin-bottom: 16px;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color .15s ease, box-shadow .15s ease;
}

.my-sites-table .mst-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.my-sites-table .mst-row:hover {
  background: #f9fafb;
}

.my-sites-table[data-view="grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 280px));
  gap: 10px;
  padding: 10px;
  background: #f8fafc;
}

.my-sites-table[data-view="grid"] .mst-header {
  display: none;
}

.my-sites-table[data-view="grid"] .mst-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid #e5e7eb;
  margin: 0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  background: #fff;
  border-bottom: none;
  overflow: hidden;
  position: relative;
  min-width: 200px;
  max-width: 280px;
  width: 100%;
}

/* Grid delete button - positioned at top right */
.grid-delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transform: translateY(-4px) scale(0.9);
}

.grid-delete-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.5);
  transform: translateY(0) scale(1.1);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
}

.grid-delete-btn:active {
  transform: translateY(0) scale(0.95);
}

.grid-delete-btn svg {
  color: #dc2626;
  transition: all 0.2s ease;
  width: 18px;
  height: 18px;
}

.grid-delete-btn:hover svg {
  color: #b91c1c;
  transform: rotate(5deg);
}

/* Show delete button on hover for grid view */
.my-sites-table[data-view="grid"] .mst-row:hover .grid-delete-btn {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.my-sites-table[data-view="grid"] .mst-col {
  padding-right: 0;
}

.my-sites-table[data-view="grid"] .mst-col-site {
  text-align: center;
}

.my-sites-table[data-view="grid"] .mst-col-site .site-head {
  gap: 0;
  justify-content: flex-start;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
  padding: 140px 0 0 0;
}

.my-sites-table[data-view="grid"] .site-thumb {
  width: 100%;
  height: 140px;
  border-radius: 12px 12px 0 0;
  flex-basis: auto;
  margin: 0;
  object-fit: cover;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.my-sites-table[data-view="grid"] .site-meta .site-title a {
  position: relative;
  letter-spacing: .2px;
}

.my-sites-table[data-view="grid"] .mst-col-site .site-meta {
  padding: 0 8px;
}
.webo-cache-btn {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  cursor: pointer;
}

.webo-cache-btn:hover {
  background: #fee2e2;
}

.webo-cache-btn.is-loading {
  opacity: 0.7;
  cursor: default;
}

/* Loading overlay */
.cache-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: 12px;
}

.cache-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  font-weight: 600;
  color: #0f172a;
}

.cache-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  border-top-color: #0ea5e9;
  animation: webo-spin 0.8s linear infinite;
}

@keyframes webo-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Toast */
.webo-cache-toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 99999;
}

.webo-cache-toast {
  min-width: 280px;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  transition: opacity .25s ease, transform .25s ease;
}

.webo-cache-toast-success {
  border-color: #86efac;
}

.webo-cache-toast-error {
  border-color: #fca5a5;
}

.webo-cache-toast-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.webo-cache-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.webo-cache-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #475569;
}

.webo-cache-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.webo-cache-step.ok .webo-cache-step-dot {
  background: #22c55e;
}

.webo-cache-step.fail .webo-cache-step-dot {
  background: #ef4444;
}

.webo-cache-step-label {
  font-weight: 600;
  color: #0f172a;
}

.webo-cache-step-msg {
  color: #64748b;
}

.webo-cache-toast.is-hide {
  opacity: 0;
  transform: translateY(8px);
}

.my-sites-table[data-view="grid"] .site-quick {
  margin-top: 3px;
  justify-content: center;
  display: flex;
  gap: 3px;
}

.my-sites-table[data-view="grid"] .mst-col-info {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.my-sites-table[data-view="grid"] .mst-col-actions {
  display: grid;
  gap: 4px;
  padding: 0 8px 8px 8px;
}

/* Hide delete button in grid view actions column */
.my-sites-table[data-view="grid"] .mst-col-actions .action-danger {
  display: none;
}

.my-sites-table[data-view="grid"] .action-link {
  justify-content: center;
  padding: 6px;
  font-weight: 700;
  border-radius: 6px;
  font-size: 14px;
}

.my-sites-table[data-view="grid"] .mst-col-actions .action-link:nth-child(1) {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}

.my-sites-table[data-view="grid"] .mst-col-actions .action-link:nth-child(1):hover {
  filter: brightness(1.05);
}

.my-sites-table[data-view="grid"] .mst-col-actions .action-link:nth-child(2) {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.my-sites-table[data-view="grid"] .mst-col-actions .action-link:nth-child(2):hover {
  filter: brightness(1.05);
}


.my-sites-table[data-view="grid"] .mst-col-status {
  text-align: center;
}

.my-sites-table .mst-col {
  padding-right: 12px;
}

.mst-col-site .site-title a {
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.site-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.site-thumb {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  flex: 0 0 40px;
}

.site-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mst-col-site .site-url {
  color: #94a3b8;
  font-size: 14px;
  margin-top: 2px;
}

.site-quick {
  margin-top: 8px;
}

.site-quick .chip {
  display: inline-block;
  background: #eef2ff;
  border: 1px solid transparent;
  color: #3730a3;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 14px;
  margin-right: 8px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.site-quick .chip:hover {
  background: #e0e7ff;
  color: #312e81;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.chip-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.mst-col-info .chip-soft {
  display: inline-block;
  background: #f0f9ff;
  color: #0369a1;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 600;
  border: 1px solid #bae6fd;
  text-align: center;
}

.storage {
  max-width: 460px;
}

.storage-text {
  color: #64748b;
  font-size: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.storage-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.storage-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #10b981);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 9999px;
  margin-right: 6px;
  font-weight: 700;
  letter-spacing: .2px;
}

.badge-success {
  background: #dcfce7;
  color: #065f46;
}

.badge-black {
  background: #374151;
  color: #ffffff;
}

.badge-warning {
  background: #ffedd5;
  color: #92400e;
}

.action-link {
  display: inline-flex;
  align-items: center;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  text-decoration: none;
  margin-right: 5px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
  font-weight: 600;
  margin-bottom: 5px
}

.action-link.action-manage {
  color: #065f46;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.action-link.action-manage:hover {
  color: #064e3b;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.action-link:hover {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.action-danger {
  color: #dc2626;
  background: #fff7f7;
  border-color: #fecaca;
}

.action-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}

@media (max-width: 1024px) {

  .my-sites-table .mst-header,
  .my-sites-table .mst-row {
    grid-template-columns: 1.5fr 1.5fr 1fr 0.7fr;
  }
}

@media (max-width: 768px) {

  .my-sites-table .mst-header,
  .my-sites-table .mst-row {
    grid-template-columns: 1fr;
  }

  .my-sites-table .mst-header {
    display: none;
  }

  .my-sites-table .mst-row {
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 14px;
    margin: 10px 8px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
  }

  .mst-col {
    padding-right: 0;
  }

  .mst-col-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .mst-col-actions .action-link {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-width: 120px;
    margin-bottom: 8px;
  }

  .mst-col-actions .action-link:not(:last-child) {
    margin-bottom: 8px;
  }

  .mst-col-actions .action-danger {
    flex-basis: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .site-quick .chip {
    margin-top: 6px;
  }

  .storage {
    margin-top: 8px;
  }

  .site-quick {
    margin-top: 10px;
    row-gap: 8px;
  }

  .mst-col-info .chip-soft {
    display: inline-block;
    margin-top: 8px;
    margin-bottom: 10px;
  }

  .mst-col-status {
    margin-top: 8px;
  }

  .mst-col-status .badge {
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
  }
}

@media (max-width: 480px) {
  .my-sites-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .my-sites-toolbar .btn-primary,
  .my-sites-toolbar .btn-secondary {
    flex: 1 1 100%;
    justify-content: center;
  }

  .site-head {
    gap: 8px;
  }

  .site-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .mst-col-site .site-title a {
    font-size: 15px;
  }

  .mst-col-site .site-url {
    font-size: 14px;
  }

  .storage-text {
    font-size: 14px;
  }

  .chip,
  .site-quick .chip {
    padding: 5px 10px;
    font-size: 14px;
  }

  .action-link {
    padding: 10px 12px;
    border-radius: 10px;
  }

  .mst-col-actions {
    gap: 6px;
  }

  .mst-col-actions .action-link {
    flex: 1 1 100%;
    min-width: auto;
    margin-bottom: 6px;
  }

  .mst-col-actions .action-danger {
    margin-top: 2px;
  }
}



/* ===== DRAG EFFECT ===== */

.membership-group-heading {
  cursor: grab !important;
  cursor: -webkit-grab;
  user-select: none;
}

.membership-group-heading.dragging {
  opacity: 0.5;
}

.membership-group-heading {
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

/* Item khi đang kéo */
.membership-group-heading.dragging {
  background: #E0F2FE;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  transform: scale(1.02);
  cursor: grabbing !important;
  cursor: -webkit-grabbing;
}

/* Các group khác bị đẩy */
.membership-group-heading.sort-shift {
  transform: translateY(6px);
}