/* ── Contact Page ── */
.contact-page { min-height: 100%; }

.ct-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.ct-title-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-left: 4px solid #7c3aed;
  padding-left: var(--space-sm);
}

.ct-title-wrap .page-title-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.ct-title-wrap .page-title-back:hover {
  background: #f5f3ff;
  color: #7c3aed;
}

.ct-title-wrap .page-title-back svg { width: 20px; height: 20px; }

.ct-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.ct-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.ct-stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.ct-stat-card[data-tab] {
  cursor: pointer;
}

.ct-stat-card.is-active-filter {
  box-shadow: 0 0 0 2px #7c3aed;
}

.ct-stat-info { flex: 1; }

.ct-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: #f5f3ff;
  flex-shrink: 0;
}

.ct-stat-icon svg { width: 24px; height: 24px; color: #7c3aed; }

.ct-stat-card.is-customer .ct-stat-icon { background: #eff6ff; }
.ct-stat-card.is-customer .ct-stat-icon svg { color: #2563eb; }
.ct-stat-card.is-supplier .ct-stat-icon { background: #ecfdf5; }
.ct-stat-card.is-supplier .ct-stat-icon svg { color: #059669; }
.ct-stat-card.is-due .ct-stat-icon { background: #fef2f2; }
.ct-stat-card.is-due .ct-stat-icon svg { color: #dc2626; }

.ct-drawer-hero {
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  background: #f5f3ff;
  border-radius: var(--radius-md);
}

.ct-drawer-hero.is-hidden { display: none; }

.ct-drawer-hero-title {
  margin: 8px 0 0;
  font-family: var(--font-bn);
  font-size: var(--text-md);
}

.ct-mobile-list {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.ct-mobile-list.is-visible { display: flex; }

.ct-mobile-card {
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.ct-mobile-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: 6px;
  font-family: var(--font-bn);
}

.ct-mobile-card-body {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.ct-stat-card.is-total { border-top: 3px solid #7c3aed; }
.ct-stat-card.is-customer { border-top: 3px solid #2563eb; }
.ct-stat-card.is-supplier { border-top: 3px solid #059669; }
.ct-stat-card.is-due { border-top: 3px solid #dc2626; }

.ct-stat-label {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.ct-stat-value {
  font-family: var(--font-en);
  font-size: var(--text-xl);
  font-weight: 700;
}

.ct-stat-card.is-total .ct-stat-value { color: #7c3aed; }
.ct-stat-card.is-customer .ct-stat-value { color: #2563eb; }
.ct-stat-card.is-supplier .ct-stat-value { color: #059669; }
.ct-stat-card.is-due .ct-stat-value { color: #dc2626; }

.ct-stat-sub {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

.ct-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.ct-filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.ct-filter-tab {
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.ct-filter-tab.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.ct-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 180px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.ct-search-wrap svg { width: 16px; height: 16px; color: var(--color-text-muted); }

.ct-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  background: transparent;
}

.toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.toolbar-icon-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
  background: #f5f3ff;
}

.toolbar-icon-btn svg { width: 18px; height: 18px; }

.ct-table-meta {
  margin: var(--space-md) 0 var(--space-sm);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.ct-table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ct-table-card.is-hidden { display: none; }
.ct-table-scroll { overflow-x: auto; }

.ct-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ct-table thead { background: #f5f3ff; }

.ct-table th {
  padding: 12px 14px;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 700;
  color: #6d28d9;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.ct-table td {
  padding: 12px 14px;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.ct-table tbody tr { cursor: pointer; }
.ct-table tbody tr:hover { background: #faf5ff; }

.ct-cell-address {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
}

.ct-cell-money { font-family: var(--font-en); white-space: nowrap; }
.ct-cell-money.is-due { color: #dc2626; font-weight: 600; }

.ct-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
}

.ct-badge.is-customer { background: #eff6ff; color: #2563eb; }
.ct-badge.is-supplier { background: #ecfdf5; color: #059669; }

.ct-actions { display: flex; gap: 6px; white-space: nowrap; }

.ct-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.ct-action-btn:hover { border-color: #7c3aed; color: #7c3aed; }
.ct-action-btn.is-danger:hover { border-color: #dc2626; color: #dc2626; }
.ct-action-btn svg { width: 16px; height: 16px; }

.ct-empty-state { display: none; text-align: center; padding: var(--space-xl); }
.ct-empty-state.is-visible { display: block; }

.ct-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 300;
  padding: 12px 20px;
  background: #111827;
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  transition: transform 0.3s ease;
}

.ct-toast.is-visible { transform: translateX(-50%) translateY(0); }
.ct-toast.is-error { background: #991b1b; }

.ct-detail-meta { margin-bottom: var(--space-md); }

.ct-detail-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
}

.ct-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-md);
}

.ct-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

@media (max-width: 992px) {
  .ct-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ct-table-card { display: none !important; }
  .ct-mobile-list.is-visible { display: flex; }
  .ct-search-box { min-width: 0; }
}

@media (max-width: 768px) {
  .ct-stats-grid { grid-template-columns: 1fr; }
  .ct-toolbar { flex-direction: column; align-items: stretch; }
  .ct-search-box { width: 100%; min-width: 0; }
  .ct-table-card { display: none; }
  .ct-mobile-list.is-visible { display: flex; }
}
