/* DASHBOARD LAYOUT */

.ts-dashboard {
  padding: 32px 40px 40px;
  background: radial-gradient(circle at top left, #111827 0%, #020617 55%, #020617 100%);
  min-height: calc(100vh - 72px); /* adjust for header height */
}

/* ============================= */
/* DASH HEADER + TEAM MODULE     */
/* ============================= */

.ts-dash-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

/* we don't want left/right containers to fight layout */
.ts-dash-header-left,
.ts-dash-header-right {
  display: contents;
}

/* if you ever show the logo inside the mock */
.ts-dash-logo {
  height: 24px;
  flex-shrink: 0;
}

/* TEAM: avatar + text */
.ts-dash-team-module {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Circular 22 avatar */
.ts-dash-team-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #ff7a32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #f9fafb;
  box-shadow: 0 0 0 1px #020617, 0 6px 14px rgba(0, 0, 0, 0.55);
}

/* Team text */
.ts-dash-team-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}

.ts-dash-team-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(148, 163, 184, 0.9);
}

.ts-dash-team-name {
  font-size: 20px;
  font-weight: 600;
  color: #f9fafb;
}

.ts-dash-team-series {
  font-size: 14px;
  color: #a5b4fc;
}

/* second row under the team info: Season + user */
.ts-dash-header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 62px; /* visually lines up under team name */
}

/* Season pill */
.ts-dash-season {
  padding: 6px 14px;
  border-radius: 999px;
  background: #1a1d25;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 14px;
}

/* User (Crew Chief + DR avatar) */
.ts-dash-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ts-dash-user-name {
  color: rgba(249, 250, 251, 0.9);
  font-size: 14px;
}

.ts-dash-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #f9fafb;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* main grid */

.ts-dash-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ts-dash-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr;
  gap: 20px;
}

.ts-dash-row-top {
  grid-template-columns: 2.2fr 2fr;
}

/* ============ */
/* CARDS        */
/* ============ */

.ts-card {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 16px 18px 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.7);
}

.ts-card-lg {
  padding: 18px 20px 20px;
}

.ts-card-chart {
  position: relative;
}

.ts-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ts-card-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #e5e7eb;
}

.ts-card-subtitle {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 14px;
}

/* ===================== */
/* TAGS & STATUS CHIPS   */
/* ===================== */

.ts-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: rgba(209, 213, 219, 0.9);
}

.ts-tag-orange {
  background: rgba(255, 122, 50, 0.12);
  border-color: rgba(255, 122, 50, 0.75);
  color: #fed7aa;
}

.ts-tag-green {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.7);
  color: #bbf7d0;
}

/* ============ */
/* METRICS      */
/* ============ */

.ts-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.ts-metric-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ts-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ts-metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.9);
}

.ts-metric-value {
  font-size: 18px;
  font-weight: 600;
  color: #f9fafb;
}

.ts-metric-delta {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
}

.ts-metric-good {
  color: #4ade80;
}

.ts-metric-warn {
  color: #f97316;
}

/* ===================== */
/* CHART PLACEHOLDER     */
/* ===================== */

.ts-card-legend {
  margin-left: auto;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  display: inline-block;
}

.ts-dot-white {
  background: #f9fafb;
}

.ts-dot-blue {
  background: #3b82f6;
}

.ts-chart-placeholder {
  margin-top: 12px;
  position: relative;
  height: 150px;
  border-radius: 10px;
  background: radial-gradient(circle at top left, #020617, #020617 55%, #020617 100%);
  overflow: hidden;
}

.ts-chart-line {
  position: absolute;
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  opacity: 0.7;
}

.ts-chart-line-white {
  border-bottom: 2px solid rgba(249, 250, 251, 0.7);
  transform: translateY(-10px);
}

.ts-chart-line-blue {
  border-bottom: 2px solid rgba(59, 130, 246, 0.8);
  transform: translateY(14px);
}

.ts-chart-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #ff7a32;
  box-shadow: 0 0 0 4px rgba(255, 122, 50, 0.28);
}

.ts-chart-dot-1 {
  left: 20%;
  top: 40%;
}

.ts-chart-dot-2 {
  left: 47%;
  top: 55%;
}

.ts-chart-dot-3 {
  left: 78%;
  top: 42%;
}

.ts-chart-caption {
  position: absolute;
  bottom: 6px;
  left: 10px;
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
}

/* ============ */
/* SETUP GRID   */
/* ============ */

.ts-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 24px;
  margin-bottom: 10px;
}

.ts-setup-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(209, 213, 219, 0.9);
}

.ts-setup-row strong {
  font-weight: 600;
  color: #e5e7eb;
}

.ts-link-muted {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  text-decoration: none;
}

/* ======= */
/* TABLE   */
/* ======= */

.ts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.ts-table th,
.ts-table td {
  padding: 6px 4px;
}

.ts-table thead th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.9);
  border-bottom: 1px solid rgba(31, 41, 55, 1);
}

.ts-table tbody td {
  color: rgba(209, 213, 219, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 1);
}

.ts-table-right {
  text-align: right;
}

.ts-table-center {
  text-align: center;
}

/* =============== */
/* BUDGET BAR      */
/* =============== */

.ts-budget-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  overflow: hidden;
  margin-bottom: 8px;
}

.ts-budget-spent {
  width: 78%;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #ff7a32);
}

.ts-budget-marker {
  position: absolute;
  right: 0;
  top: -3px;
  width: 2px;
  height: 16px;
  background: rgba(249, 250, 251, 0.7);
}

.ts-budget-text,
.ts-budget-breakdown {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.95);
}

/* ================= */
/* SPONSOR LIST      */
/* ================= */

.ts-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(209, 213, 219, 0.9);
}

.ts-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 6px;
  display: inline-block;
}

.ts-status-ok {
  background: #22c55e;
}

.ts-status-warn {
  background: #f97316;
}

.ts-status-bad {
  background: #ef4444;
}

/* ================================ */
/* INTERACTIVE DASHBOARD STYLES    */
/* ================================ */

/* TOAST NOTIFICATIONS */
.ts-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-toast {
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: #f9fafb;
  font-size: 13px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: ts-toast-in 0.3s ease;
  max-width: 320px;
}

.ts-toast-success { border-left: 3px solid #22c55e; }
.ts-toast-warning { border-left: 3px solid #f97316; }
.ts-toast-error { border-left: 3px solid #ef4444; }
.ts-toast-info { border-left: 3px solid #3b82f6; }

.ts-toast.ts-toast-out {
  animation: ts-toast-out 0.3s ease forwards;
}

@keyframes ts-toast-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ts-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* DROPDOWNS */
.ts-dropdown {
  position: relative;
  display: inline-block;
}

.ts-dropdown-trigger {
  cursor: pointer;
  transition: color 0.15s ease;
}

.ts-dropdown-trigger:hover {
  color: #ffffff;
}

.ts-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.ts-dropdown.active .ts-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ts-dropdown-right {
  left: auto;
  right: 0;
}

.ts-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(209, 213, 219, 0.9);
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-dropdown-item:hover {
  background: rgba(255, 122, 50, 0.1);
  color: #ffffff;
}

.ts-dropdown-item.active {
  color: #ff7a32;
}

.ts-dropdown-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.15);
  margin: 6px 0;
}

/* HEADER EXTRAS */
.ts-dash-import {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ts-import-status {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.7);
}

.ts-btn-small {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ts-btn-outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f9fafb;
}

.ts-btn-outline:hover {
  border-color: #ff7a32;
  background: rgba(255, 122, 50, 0.1);
}

.ts-dash-notifications {
  position: relative;
  cursor: pointer;
}

.ts-notification-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(249, 250, 251, 0.8);
  transition: all 0.15s ease;
}

.ts-notification-bell:hover {
  background: rgba(255, 122, 50, 0.15);
  color: #ff7a32;
}

.ts-notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #ef4444;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CARD INTERACTIONS */
.ts-card-interactive {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ts-card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.8);
}

.ts-clickable {
  cursor: pointer;
  transition: color 0.15s ease;
}

.ts-clickable:hover {
  color: #ff7a32;
}

/* METRIC INTERACTIONS */
.ts-metric-clickable {
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-metric-clickable:hover {
  background: rgba(255, 122, 50, 0.08);
}

.ts-metric-pulse {
  animation: ts-pulse 2s ease-in-out infinite;
}

@keyframes ts-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* TAG INTERACTIONS */
.ts-tag-clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.ts-tag-clickable:hover {
  transform: scale(1.05);
  border-color: rgba(255, 122, 50, 0.8);
}

.ts-tag-action {
  cursor: pointer;
}

.ts-tag-action:hover {
  filter: brightness(1.2);
}

/* CHART INTERACTIONS */
.ts-chart-placeholder {
  cursor: crosshair;
}

.ts-chart-dot {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ts-chart-dot:hover {
  transform: scale(1.5);
  box-shadow: 0 0 0 6px rgba(255, 122, 50, 0.4);
}

.ts-chart-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 122, 50, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #f9fafb;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  white-space: nowrap;
}

.ts-chart-tooltip.active {
  opacity: 1;
}

.ts-chart-crosshair {
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(255, 122, 50, 0.3);
  pointer-events: none;
  opacity: 0;
}

.ts-legend-item {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ts-legend-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ts-legend-item.disabled .ts-dot {
  opacity: 0.3;
}

/* SETUP EDITING */
.ts-setup-editable {
  position: relative;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-setup-editable:hover {
  background: rgba(255, 122, 50, 0.08);
}

.ts-edit-icon {
  position: absolute;
  right: 8px;
  opacity: 0;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.8);
  transition: opacity 0.15s ease;
}

.ts-setup-editable:hover .ts-edit-icon {
  opacity: 1;
}

.ts-link-animated {
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
}

.ts-link-animated:hover {
  color: #ff7a32;
}

/* TABLE INTERACTIONS */
.ts-table-interactive .ts-sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.ts-table-interactive .ts-sortable:hover {
  color: #ff7a32;
}

.ts-sort-icon {
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.5;
}

.ts-sortable.sorted-asc .ts-sort-icon::after { content: '↑'; }
.ts-sortable.sorted-desc .ts-sort-icon::after { content: '↓'; }

.ts-table-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-table-row-clickable:hover {
  background: rgba(255, 122, 50, 0.06);
}

.ts-table-row-clickable.expanded {
  background: rgba(255, 122, 50, 0.1);
}

.ts-life-bar {
  width: 60px;
  height: 4px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.ts-life-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #ef4444);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.ts-life-fill.ts-life-ok {
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.ts-life-fill.ts-life-warn {
  background: linear-gradient(90deg, #f97316, #ea580c);
}

.ts-component-detail {
  display: none;
  padding: 16px;
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.ts-component-detail.active {
  display: block;
  animation: ts-expand 0.2s ease;
}

@keyframes ts-expand {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 400px; }
}

/* BUDGET INTERACTIONS */
.ts-budget-interactive {
  cursor: pointer;
}

.ts-budget-segments {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ts-budget-interactive:hover .ts-budget-segments {
  opacity: 1;
}

.ts-budget-segment {
  height: 100%;
  transition: filter 0.15s ease;
}

.ts-budget-segment[data-category="tires"] { background: #3b82f6; }
.ts-budget-segment[data-category="travel"] { background: #8b5cf6; }
.ts-budget-segment[data-category="fuel"] { background: #f97316; }
.ts-budget-segment[data-category="parts"] { background: #22c55e; }

.ts-budget-cat {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.ts-budget-cat:hover {
  background: rgba(255, 255, 255, 0.1);
}

.ts-budget-cat.highlighted {
  background: rgba(255, 122, 50, 0.2);
  color: #ff7a32;
}

/* SPONSOR DELIVERABLES */
.ts-deliverable {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin: -4px -10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ts-deliverable:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ts-deliverable-text {
  flex: 1;
}

.ts-deliverable-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ts-deliverable:hover .ts-deliverable-actions {
  opacity: 1;
}

.ts-action-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ts-action-btn:hover {
  background: rgba(255, 122, 50, 0.2);
}

.ts-action-check {
  color: #22c55e;
}

.ts-action-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.ts-action-urgent:hover {
  background: rgba(239, 68, 68, 0.4);
}

.ts-status-pulse {
  animation: ts-status-pulse 1.5s ease-in-out infinite;
}

@keyframes ts-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.ts-deliverable.completed .ts-deliverable-text {
  text-decoration: line-through;
  opacity: 0.6;
}

/* MODAL */
.ts-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.ts-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ts-modal {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.2s ease;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.ts-modal-overlay.active .ts-modal {
  transform: scale(1) translateY(0);
}

.ts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ts-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f9fafb;
}

.ts-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(148, 163, 184, 0.9);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ts-modal-close:hover {
  background: rgba(255, 122, 50, 0.2);
  color: #ff7a32;
}

.ts-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 60vh;
}

.ts-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

/* Modal content styles */
.ts-modal-section {
  margin-bottom: 20px;
}

.ts-modal-section:last-child {
  margin-bottom: 0;
}

.ts-modal-section h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.9);
  margin: 0 0 12px;
}

.ts-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ts-modal-stat {
  background: rgba(15, 23, 42, 0.6);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}

.ts-modal-stat-value {
  font-size: 20px;
  font-weight: 600;
  color: #f9fafb;
}

.ts-modal-stat-label {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.8);
  margin-top: 4px;
}

.ts-lap-table {
  width: 100%;
  font-size: 12px;
}

.ts-lap-table th,
.ts-lap-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.ts-lap-table th {
  color: rgba(148, 163, 184, 0.9);
  font-weight: 500;
}

.ts-mini-chart {
  height: 80px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.ts-mini-chart-bar {
  position: absolute;
  bottom: 0;
  width: 8px;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  border-radius: 2px 2px 0 0;
}

.ts-form-group {
  margin-bottom: 16px;
}

.ts-form-group label {
  display: block;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 6px;
}

.ts-form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #f9fafb;
  font-size: 14px;
  transition: border-color 0.15s ease;
}

.ts-form-input:focus {
  outline: none;
  border-color: #ff7a32;
}

.ts-btn-modal {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ts-btn-modal-primary {
  background: linear-gradient(135deg, #ff7a32, #ff944d);
  border: none;
  color: #020617;
}

.ts-btn-modal-primary:hover {
  filter: brightness(1.1);
}

.ts-btn-modal-secondary {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f9fafb;
}

.ts-btn-modal-secondary:hover {
  border-color: rgba(148, 163, 184, 0.5);
}

/* ================================ */
/* RESPONSIVE / MOBILE STYLES      */
/* ================================ */

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .ts-dashboard {
    padding: 24px 24px 32px;
  }

  .ts-dash-row {
    grid-template-columns: 1fr 1fr;
  }

  .ts-dash-row-top {
    grid-template-columns: 1fr;
  }

  .ts-dash-header-meta {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 12px;
  }

  .ts-metric-grid {
    gap: 10px;
  }

  .ts-modal {
    max-width: 90%;
  }

  .ts-modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .ts-dashboard {
    padding: 16px 16px 24px;
  }

  /* Header adjustments */
  .ts-dash-header {
    gap: 12px;
    margin-bottom: 16px;
  }

  .ts-dash-team-module {
    gap: 10px;
  }

  .ts-dash-team-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .ts-dash-team-name {
    font-size: 16px;
  }

  .ts-dash-team-series {
    font-size: 12px;
  }

  .ts-dash-header-meta {
    margin-left: 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  .ts-dash-import {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .ts-import-status {
    font-size: 11px;
  }

  /* Hide user name on mobile, show only avatar */
  .ts-dash-user-name {
    display: none;
  }

  /* Main grid - single column on mobile */
  .ts-dash-main {
    gap: 16px;
  }

  .ts-dash-row,
  .ts-dash-row-top {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Cards */
  .ts-card {
    padding: 14px 14px 16px;
    border-radius: 10px;
  }

  .ts-card-lg {
    padding: 14px 16px 16px;
  }

  .ts-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .ts-card-header h2 {
    font-size: 14px;
    width: 100%;
  }

  /* Metrics */
  .ts-metric-grid,
  .ts-metric-grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .ts-metric-value {
    font-size: 16px;
  }

  .ts-metric-label {
    font-size: 10px;
  }

  .ts-metric-delta {
    font-size: 11px;
  }

  .ts-metric-clickable {
    padding: 6px;
    margin: -6px;
  }

  /* Chart */
  .ts-chart-placeholder {
    height: 120px;
  }

  .ts-card-legend {
    font-size: 10px;
    gap: 6px;
  }

  .ts-chart-caption {
    font-size: 10px;
  }

  /* Setup grid */
  .ts-setup-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ts-setup-row {
    font-size: 12px;
  }

  /* Table */
  .ts-table {
    font-size: 12px;
  }

  .ts-table th,
  .ts-table td {
    padding: 8px 4px;
  }

  .ts-table thead th {
    font-size: 10px;
  }

  .ts-life-bar {
    width: 50px;
  }

  .ts-life-value {
    font-size: 11px;
  }

  /* Tags */
  .ts-tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* Budget */
  .ts-budget-text,
  .ts-budget-breakdown {
    font-size: 11px;
  }

  .ts-budget-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  /* Sponsor list */
  .ts-list {
    font-size: 12px;
    gap: 4px;
  }

  .ts-deliverable {
    padding: 10px 8px;
    margin: -4px -8px;
  }

  .ts-deliverable-text {
    font-size: 12px;
    line-height: 1.3;
  }

  /* Show action buttons always on mobile (touch devices) */
  .ts-deliverable-actions {
    opacity: 1;
  }

  .ts-action-btn {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  /* Modal */
  .ts-modal {
    width: 95%;
    max-width: none;
    max-height: 90vh;
    border-radius: 12px;
  }

  .ts-modal-header {
    padding: 14px 16px;
  }

  .ts-modal-title {
    font-size: 16px;
  }

  .ts-modal-body {
    padding: 16px;
    max-height: 55vh;
  }

  .ts-modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
  }

  .ts-btn-modal {
    width: 100%;
    padding: 12px 20px;
    text-align: center;
  }

  .ts-modal-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ts-modal-stat {
    padding: 10px;
  }

  .ts-modal-stat-value {
    font-size: 18px;
  }

  .ts-form-group {
    margin-bottom: 12px;
  }

  .ts-form-input {
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* Dropdowns */
  .ts-dropdown-menu {
    min-width: 180px;
  }

  .ts-dropdown-item {
    padding: 12px 16px;
  }

  /* Toast */
  .ts-toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .ts-toast {
    max-width: none;
    width: 100%;
  }

  /* Notifications */
  .ts-notification-bell {
    width: 40px;
    height: 40px;
  }

  /* Season pill */
  .ts-dash-season {
    padding: 5px 12px;
    font-size: 13px;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .ts-dashboard {
    padding: 12px 12px 20px;
  }

  .ts-dash-team-name {
    font-size: 14px;
  }

  .ts-dash-team-series {
    font-size: 11px;
  }

  .ts-dash-team-label {
    font-size: 10px;
  }

  /* Stack metrics vertically on very small screens */
  .ts-metric-grid,
  .ts-metric-grid-3 {
    grid-template-columns: 1fr;
  }

  .ts-card-header h2 {
    font-size: 13px;
  }

  /* Full-width modal on tiny screens */
  .ts-modal {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .ts-modal-body {
    max-height: calc(100vh - 140px);
  }

  .ts-modal-grid {
    grid-template-columns: 1fr;
  }

  /* Budget breakdown stack */
  .ts-budget-breakdown {
    flex-direction: column;
    gap: 2px;
  }

  /* Table scrollable on tiny screens */
  .ts-card[data-card="components"] {
    overflow-x: auto;
  }

  .ts-table {
    min-width: 320px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Always show edit icons on touch devices */
  .ts-edit-icon {
    opacity: 0.6;
  }

  /* Always show deliverable actions */
  .ts-deliverable-actions {
    opacity: 1;
  }

  /* Larger touch targets */
  .ts-setup-editable {
    padding: 10px 8px;
    margin: -10px -8px;
  }

  .ts-table-row-clickable td {
    padding: 12px 4px;
  }

  .ts-dropdown-item {
    padding: 14px 16px;
  }

  .ts-legend-item {
    padding: 6px 10px;
  }

  .ts-budget-cat {
    padding: 6px 10px;
  }

  /* Disable hover effects that don't work well on touch */
  .ts-card-interactive:hover {
    transform: none;
  }

  .ts-chart-dot:hover {
    transform: scale(1.3);
  }
}

/* Landscape phone orientation */
@media (max-width: 896px) and (orientation: landscape) {
  .ts-dashboard {
    padding: 12px 20px 20px;
  }

  .ts-dash-row,
  .ts-dash-row-top {
    grid-template-columns: 1fr 1fr;
  }

  .ts-modal {
    max-height: 85vh;
  }

  .ts-modal-body {
    max-height: 50vh;
  }
}

/* Dark mode / OLED optimization - ensure pure blacks for battery saving */
@media (prefers-color-scheme: dark) {
  .ts-dashboard {
    background: radial-gradient(circle at top left, #0a0f1a 0%, #000000 55%, #000000 100%);
  }
}