/**
 * Dashboard layout and controls – matches csm-ui. Literal values only.
 */

.dashboard {
  padding: 12px;
  max-width: none;
  margin: 0;
  position: relative;
  overflow: visible;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-controls-row {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.dashboard-header {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-title-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.dashboard-title-row h1 {
  margin: 0;
}

.dashboard-subtitle {
  margin-top: 4px;
  font-size: 14px;
  color: #6b7280;
}

.dashboard-info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dashboard-info-tooltip .button {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(210, 210, 210, 0.9);
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f3f3f3 40%, #e7e7e7 70%, #d9d9d9 100%);
  box-shadow: 0 0 0 2px rgba(220, 220, 220, 0.6), 0 6px 14px rgba(120, 120, 120, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: -2px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.dashboard-info-tooltip .button::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: conic-gradient(from 120deg, rgba(255, 255, 255, 0) 0deg, rgba(230, 230, 230, 0.9) 90deg, rgba(200, 200, 200, 0.7) 160deg, rgba(255, 255, 255, 0) 240deg);
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 0;
}

.dashboard-info-tooltip .button::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  top: 2px;
  right: 2px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  opacity: 0.9;
}

.dashboard-info-tooltip .button:hover,
.dashboard-info-tooltip .button:focus,
.dashboard-info-tooltip .button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(210, 210, 210, 0.8), 0 8px 18px rgba(120, 120, 120, 0.28);
  filter: brightness(1.02);
}

.dashboard-info-tooltip .button:hover::before,
.dashboard-info-tooltip .button:focus::before,
.dashboard-info-tooltip .button:focus-visible::before {
  opacity: 1;
  transform: scale(1.04);
}

.dashboard-info-tooltip .info-letter {
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  font-family: "Times New Roman", Georgia, serif;
  color: #2b2b2b;
  line-height: 1;
  z-index: 2;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.dashboard-info-tooltip .tooltip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  background-color: rgb(134, 134, 134);
  color: white;
  padding: 4px 8px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-duration: .3s;
  pointer-events: none;
  letter-spacing: 0.3px;
  white-space: nowrap;
  font-size: 11px;
}

.dashboard-info-tooltip .button:hover .tooltip,
.dashboard-info-tooltip .button:focus .tooltip,
.dashboard-info-tooltip .button:focus-visible .tooltip {
  opacity: 1;
}

.dashboard-controls-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  margin-left: auto;
  width: 100%;
  max-width: 32rem;
  flex: 1;
}

.controls-row {
  display: flex;
  width: 100%;
  gap: 8px;
  align-items: center;
}

.controls-row-top {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.controls-row-bottom {
  justify-content: flex-end;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 26rem;
}

@media (min-width: 640px) {
  .search-wrapper {
    width: 26rem;
  }
}

.search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 40px; /* pl-10 for icon */
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  min-height: 36px;
  box-sizing: border-box;
}

.search-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.filters-container {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

.date-range-select {
  padding: 9px 36px 9px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  position: relative;
  z-index: 100;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  width: auto;
  min-width: 10rem;
  min-height: 38px;
  box-sizing: border-box;
}

.date-range-select:focus {
  outline: none;
  border-color: #1a1a1a;
  z-index: 101;
}

.vs-period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  cursor: default;
  white-space: nowrap;
}

.vs-period-btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .dashboard-controls-row {
    flex-wrap: nowrap;
    align-items: flex-start;
  }

  .dashboard-controls-stack {
    width: auto;
    max-width: none;
    flex: 0 0 auto;
  }

  .controls-row {
    width: auto;
  }
}

/* Force filter/search controls to stay at top-right on tablet/desktop. */
@media (min-width: 640px) {
  .dashboard-controls-row {
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
  }

  .dashboard-controls-row > .dashboard-header {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .dashboard-controls-row > .dashboard-controls-stack {
    margin-left: auto !important;
    flex: 0 0 auto !important;
    width: fit-content !important;
    max-width: none !important;
    align-items: flex-end !important;
  }

  .dashboard-controls-row > .dashboard-controls-stack .controls-row {
    width: 100% !important;
    justify-content: flex-end !important;
  }
}

/* Practice Performance card – rounded-xl border shadow (reference design) */
.practice-performance-card {
  background: #fff;
  border-radius: 0.75rem; /* rounded-xl */
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.practice-performance-header {
  display: flex;
  flex-direction: column;
  gap: 0.375rem; /* space-y-1.5 */
  padding: 1.5rem; /* p-6 */
}

.practice-performance-header-top {
  margin-bottom: 0;
}

.practice-performance-title {
  font-size: 1.125rem; /* text-lg */
  font-weight: 600; /* font-semibold */
  letter-spacing: -0.025em; /* tracking-tight */
  color: #111827;
  margin: 0;
}

.practice-performance-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.practice-performance-stats {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.practice-performance-stat-text {
  font-size: 0.875rem; /* text-sm */
  color: #4b5563; /* text-gray-600 */
  margin: 0;
}

.practice-performance-stat-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9ca3af;
  flex-shrink: 0;
}

.practice-performance-legend-row {
  display: flex;
  align-items: center;
  gap: 1.5rem; /* gap-6 */
  font-size: 0.875rem;
}

.practice-performance-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem; /* gap-2 */
  color: #374151;
}

.practice-performance-legend-dot {
  width: 12px; /* w-3 */
  height: 12px; /* h-3 */
  border-radius: 50%;
  flex-shrink: 0;
}

.practice-performance-legend-dot-good {
  background: #22c55e; /* green-500 */
}

.practice-performance-legend-dot-watch {
  background: #eab308; /* yellow-500 */
}

.practice-performance-legend-dot-flagged {
  background: #ef4444; /* red-500 */
}

.practice-performance-status-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #4b5563;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.practice-performance-status-filter-btn:hover {
  background: #f9fafb;
}

.practice-performance-status-filter-btn-active {
  font-weight: 500;
}

.practice-performance-status-filter-btn-active.practice-performance-status-filter-btn-good {
  background: #dcfce7;
  color: #166534;
  box-shadow: 0 0 0 2px #22c55e;
}

.practice-performance-status-filter-btn-active.practice-performance-status-filter-btn-watch {
  background: #fef9c3;
  color: #854d0e;
  box-shadow: 0 0 0 2px #eab308;
}

.practice-performance-status-filter-btn-active.practice-performance-status-filter-btn-flagged {
  background: #fee2e2;
  color: #991b1b;
  box-shadow: 0 0 0 2px #ef4444;
}

.practice-performance-status-filter-label {
  color: inherit;
}

.practice-performance-status-filter-count {
  font-weight: 500;
  color: #111827;
}

.practice-performance-configure-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem; /* h-9 */
  padding: 0 1rem; /* px-4 py-2 */
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid #d1d5db; /* border-gray-300 */
  border-radius: 0.375rem;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  cursor: pointer;
  color: #111827;
}

.practice-performance-configure-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.practice-performance-configure-btn svg {
  width: 1rem;
  height: 1rem;
}

.practice-performance-table-wrap {
  padding: 0 1.5rem 1.5rem; /* p-6 pt-0 */
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* no scrollbar when table fits */
}

@media (max-width: 900px) {
  .practice-performance-table-wrap {
    overflow-x: auto; /* enable scroll on narrow viewports */
  }
}

.practice-performance-loading {
  text-align: center;
  padding: 2.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}
