/* Client Companion Portal — white canvas, red companion motion */
:root {
  --ccb-primary: #e05252;
  --ccb-primary-hover: #c73e3e;
  --ccb-primary-soft: #fecaca;
  --ccb-red: #e05252;
  --ccb-bg: #ffffff;
  --ccb-bg-deep: #ffffff;
  --ccb-surface: #ffffff;
  --ccb-text: #1a1a1a;
  --ccb-muted: #6b5b5b;
  --ccb-border: #f5d0d0;
  --ccb-danger: #b42318;
  --ccb-success: #0d7a4d;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  color: var(--ccb-text);
  background: #ffffff;
}

/* Full-page companion atmosphere */
.ccb-page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.ccb-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #ffffff;
}

/* Drifting red orbs */
.ccb-bg-layer::before,
.ccb-bg-layer::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--ccb-red);
  filter: blur(40px);
  will-change: transform;
}

.ccb-bg-layer::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  opacity: 0.14;
  animation: ccb-orb-drift-a 22s ease-in-out infinite;
}

.ccb-bg-layer::after {
  width: 320px;
  height: 320px;
  bottom: 8%;
  left: -80px;
  opacity: 0.11;
  animation: ccb-orb-drift-b 28s ease-in-out infinite;
}

.ccb-bg-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--ccb-red);
  filter: blur(48px);
  opacity: 0.1;
  will-change: transform;
}

.ccb-bg-orb--a {
  width: 260px;
  height: 260px;
  top: 42%;
  left: 55%;
  animation: ccb-orb-drift-c 20s ease-in-out infinite;
}

.ccb-bg-orb--b {
  width: 180px;
  height: 180px;
  top: 8%;
  left: 35%;
  opacity: 0.08;
  animation: ccb-orb-drift-d 16s ease-in-out infinite;
}

.ccb-bg-orb--c {
  width: 220px;
  height: 220px;
  bottom: 22%;
  right: 18%;
  opacity: 0.09;
  animation: ccb-orb-drift-e 24s ease-in-out infinite;
}

.ccb-bg-icon {
  position: absolute;
  opacity: 0.13;
  color: var(--ccb-red);
  will-change: transform;
}

.ccb-bg-icon--chat {
  top: 18%;
  left: 8%;
  width: 88px;
  height: 88px;
  animation: ccb-icon-drift 14s ease-in-out infinite;
}

.ccb-bg-icon--heart {
  top: 55%;
  right: 12%;
  width: 64px;
  height: 64px;
  animation: ccb-icon-drift 18s ease-in-out infinite reverse;
  animation-delay: -4s;
}

.ccb-bg-icon--hand {
  bottom: 18%;
  left: 20%;
  width: 72px;
  height: 72px;
  animation: ccb-icon-drift 16s ease-in-out infinite;
  animation-delay: -7s;
}

.ccb-bg-icon--dots {
  top: 12%;
  right: 22%;
  width: 120px;
  height: 40px;
  opacity: 0.09;
  animation: ccb-icon-drift 20s ease-in-out infinite;
  animation-delay: -2s;
}

.ccb-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
}

/* Floating cards */
.ccb-card {
  background: #ffffff;
  border: 1px solid var(--ccb-border);
  border-radius: 12px;
  box-shadow:
    0 12px 40px rgb(224 82 82 / 14%),
    0 4px 16px rgb(0 0 0 / 5%);
  animation: ccb-card-float 5s ease-in-out infinite;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ccb-card:nth-child(2) { animation-delay: -1.1s; }
.ccb-card:nth-child(3) { animation-delay: -2.2s; }
.ccb-card:nth-child(4) { animation-delay: -3.3s; }
.ccb-card:nth-child(5) { animation-delay: -4.4s; }

.ccb-card:hover {
  border-color: rgb(224 82 82 / 35%);
  box-shadow:
    0 18px 48px rgb(224 82 82 / 20%),
    0 6px 20px rgb(0 0 0 / 6%);
}

.ccb-btn-primary {
  background: linear-gradient(180deg, var(--ccb-primary) 0%, var(--ccb-primary-hover) 100%);
  color: #fff;
  transition: filter 0.15s ease, transform 0.1s ease;
  box-shadow: 0 2px 8px rgb(224 82 82 / 25%);
}

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

.ccb-btn-primary:active {
  transform: scale(0.98);
}

.ccb-nav-active {
  background: rgb(224 82 82 / 12%);
  color: var(--ccb-primary-hover);
  border-right: 3px solid var(--ccb-primary);
}

.ccb-logo-mark {
  background: linear-gradient(135deg, var(--ccb-primary) 0%, #dc2626 100%);
  box-shadow: 0 2px 12px rgb(224 82 82 / 30%);
}

.ccb-step-done {
  background: var(--ccb-primary);
}

.ccb-step-todo {
  background: var(--ccb-border);
}

@keyframes ccb-orb-drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-60px, 80px) scale(1.08); }
  66% { transform: translate(40px, -50px) scale(0.94); }
}

@keyframes ccb-orb-drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(70px, -60px) scale(1.12); }
  70% { transform: translate(-30px, 40px) scale(0.9); }
}

@keyframes ccb-orb-drift-c {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-80px, 50px); }
}

@keyframes ccb-orb-drift-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 70px) scale(1.15); }
}

@keyframes ccb-orb-drift-e {
  0%, 100% { transform: translate(0, 0); }
  35% { transform: translate(-40px, -60px); }
  70% { transform: translate(55px, 30px); }
}

@keyframes ccb-icon-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(18px, -24px) rotate(4deg); }
  50% { transform: translate(-12px, -14px) rotate(-3deg); }
  75% { transform: translate(8px, -28px) rotate(2deg); }
}

@keyframes ccb-card-float {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 12px 40px rgb(224 82 82 / 14%),
      0 4px 16px rgb(0 0 0 / 5%);
  }
  50% {
    transform: translateY(-10px);
    box-shadow:
      0 22px 52px rgb(224 82 82 / 20%),
      0 10px 24px rgb(0 0 0 / 7%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ccb-bg-layer::before,
  .ccb-bg-layer::after,
  .ccb-bg-orb,
  .ccb-bg-icon,
  .ccb-card {
    animation: none;
  }
}

@media print {
  .no-print,
  .ccb-bg-layer {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  body {
    background: white;
  }

  .ccb-card {
    animation: none;
    box-shadow: none;
  }
}

.print-only {
  display: none;
}

.ccb-input {
  border: 1px solid var(--ccb-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: var(--ccb-text);
}

.ccb-input:focus {
  outline: 2px solid rgb(224 82 82 / 35%);
  outline-offset: 1px;
  border-color: var(--ccb-primary);
}

.ccb-filter-panel {
  background: #fff;
  border: 1px solid var(--ccb-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  width: 100%;
  animation: none;
}

.ccb-filter-panel .ts-wrapper {
  min-height: 42px;
  width: 100%;
}

.ccb-filter-panel .ts-wrapper.single,
.ccb-filter-panel .ts-wrapper.multi {
  width: 100%;
}

.ccb-filter-panel .ts-control {
  border-radius: 8px;
  border: 1px solid var(--ccb-border);
  min-height: 42px;
  padding: 6px 10px;
  background: #fff;
  box-shadow: none;
}

.ccb-filter-panel .ts-control:focus-within {
  border-color: var(--ccb-primary);
  box-shadow: 0 0 0 2px rgb(224 82 82 / 18%);
}

.ccb-filter-panel .ts-dropdown {
  border-color: var(--ccb-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
}

.ccb-filter-panel .ts-dropdown .active {
  background: rgb(224 82 82 / 12%);
  color: var(--ccb-primary-hover);
}

.ccb-filter-panel .item {
  background: rgb(224 82 82 / 12%) !important;
  color: var(--ccb-primary-hover) !important;
  border-radius: 6px !important;
}

.ccb-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgb(224 82 82 / 10%);
  color: var(--ccb-primary-hover);
  font-size: 0.75rem;
  font-weight: 500;
}

.ccb-data-table-wrap {
  background: #fff;
  border: 1px solid var(--ccb-border);
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  animation: none;
}

.ccb-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ccb-data-table thead {
  background: rgb(254 202 202 / 28%);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ccb-data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--ccb-muted);
  white-space: nowrap;
}

.ccb-data-table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ccb-border);
  vertical-align: middle;
}

.ccb-data-table tbody tr:hover {
  background: rgb(255 248 248 / 80%);
}

.ccb-stat-card {
  background: #fff;
  border: 1px solid var(--ccb-border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.ccb-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ccb-text);
}

.ccb-stat-label {
  font-size: 0.8rem;
  color: var(--ccb-muted);
  margin-top: 0.35rem;
}

.ccb-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--ccb-muted);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.ccb-sort-btn:hover {
  color: var(--ccb-primary-hover);
}

.ccb-sort-active {
  color: var(--ccb-primary-hover);
}

.ccb-sort-indicator {
  font-size: 0.7rem;
  min-width: 0.75rem;
  color: var(--ccb-primary);
}