/**
 * TrackTollywood Gross Table - Frontend Styles
 * Responsive, modern, beautiful table design
 */

/* Outer container for containment */
.tt-gross-container {
  margin: 0;
  padding: 0;
}

/* Container */
.tt-gross-wrap {
  margin: 1.5rem 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #1f2937;
}

/* Loading State */
.tt-gross-loading {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, #f3e5f5, #faf8fc) !important;
  border: 2px solid #d1c4e9;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(103, 58, 183, 0.1);
  max-width: 100%;
  box-sizing: border-box;
}

.tt-gross-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #ede7f6;
  border-top-color: #673ab7;
  border-radius: 50%;
  animation: tt-gross-spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

.tt-gross-loading p {
  margin: 0;
  color: #673ab7 !important;
  font-size: 14px;
  font-weight: 500;
}

/* Error State */
.tt-gross-error {
  padding: 1.5rem;
  background: linear-gradient(135deg, #fce4ec, #f8bbd0) !important;
  border: 2px solid #f48fb1;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(244, 143, 177, 0.2);
  color: #880e4f !important;
  max-width: 100%;
  box-sizing: border-box;
}

.tt-gross-error p {
  margin: 0;
  font-size: 14px;
  color: #880e4f !important;
}

.tt-gross-error strong {
  color: #ad1457 !important;
  font-weight: 600;
}

/* Empty State */
.tt-gross-empty {
  padding: 2rem 1rem;
  text-align: center;
  background: linear-gradient(135deg, #f3e5f5, #faf8fc) !important;
  border: 2px solid #d1c4e9;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(103, 58, 183, 0.1);
  max-width: 100%;
  box-sizing: border-box;
}

.tt-gross-empty p {
  margin: 0;
  color: #673ab7 !important;
  font-size: 14px;
  font-weight: 500;
}

/* Timestamp */
.tt-gross-timestamp {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #f3e5f5, #ede7f6) !important;
  border: 1px solid #d1c4e9;
  border-radius: 8px;
  color: #673ab7 !important;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(103, 58, 183, 0.08);
  max-width: 100%;
  box-sizing: border-box;
}

/* Compact timestamp for compact style */
.tt-gross-style-compact .tt-gross-timestamp {
  padding: 0.375rem 0.75rem !important;
  margin-bottom: 0.75rem !important;
  font-size: 12px !important;
  border-radius: 6px !important;
}

/* Table Wrapper - Responsive Horizontal Scroll */
.tt-gross-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 2px solid #d1c4e9;
  border-radius: 12px;
  background: #fff !important;
  box-shadow: 0 4px 6px rgba(103, 58, 183, 0.1), 0 2px 4px rgba(103, 58, 183, 0.06);
}

/* Table */
.tt-gross-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 600px;
}

/* Table Head */
.tt-gross-table thead {
  background: linear-gradient(135deg, #673ab7, #7e57c2) !important;
  border-bottom: 2px solid #5e35b1;
  box-shadow: 0 2px 4px rgba(103, 58, 183, 0.2);
}

.tt-gross-table th {
  padding: 0.875rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #ffffff !important;
  white-space: nowrap;
}

.tt-gross-th-label {
  position: sticky;
  left: 0;
  background: linear-gradient(135deg, #673ab7, #7e57c2) !important;
  z-index: 2;
  min-width: 180px;
}

.tt-gross-table .tt-gross-th-metric {
  text-align: right;
  min-width: 120px;
}

/* Table Body */
.tt-gross-table tbody tr {
  border-bottom: 1px solid #d1c4e9;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.tt-gross-table tbody tr:hover {
  background-color: #f3e5f5 !important;
  transform: scale(1.005);
}

.tt-gross-table tbody tr:last-child {
  border-bottom: none;
}

.tt-gross-row-even {
  background-color: #ffffff !important;
}

.tt-gross-row-odd {
  background-color: #faf8fc !important;
}

.tt-gross-table td {
  padding: 0.875rem 1rem;
  font-size: 14px;
  color: #424242 !important;
}

.tt-gross-td-label {
  position: sticky;
  left: 0;
  background: inherit;
  font-weight: 600;
  z-index: 1;
  border-right: 2px solid #ede7f6;
  color: #673ab7 !important;
}

.tt-gross-row-even .tt-gross-td-label {
  background-color: #ffffff !important;
}

.tt-gross-row-odd .tt-gross-td-label {
  background-color: #faf8fc !important;
}

/* ========================
   TOTAL ROW — Light Mode (all layouts)
   ======================== */
.tt-gross-row-total,
.tt-gross-row-total.tt-gross-row-even,
.tt-gross-row-total.tt-gross-row-odd {
  background-color: #f3e5f5 !important;
  border-top: 2px solid #673ab7;
}

.tt-gross-row-total td,
.tt-gross-row-total .tt-gross-td-metric,
.tt-gross-row-total .tt-gross-td-metric strong {
  font-weight: 700;
  color: #1a1a1a !important;
}

.tt-gross-row-total .tt-gross-td-label,
.tt-gross-row-total .tt-gross-td-label strong {
  background-color: #f3e5f5 !important;
  color: #4a148c !important;
}

.tt-gross-row-total .tt-gross-card-gross {
  color: #1a1a1a !important;
  font-weight: 700;
}

.tt-gross-row-total .tt-gross-card-occupancy {
  font-weight: 700;
}

.tt-gross-row-total .tt-gross-card-row-label {
  color: #6b7280 !important;
}

.tt-gross-row-total .tt-gross-card-row-value {
  color: #1a1a1a !important;
}

/* Prevent hover/tap from overriding total row background */
.tt-gross-table tbody tr.tt-gross-row-total:hover {
  background-color: #f3e5f5 !important;
  transform: none;
}

.tt-gross-table tbody tr.tt-gross-row-total:hover .tt-gross-td-label {
  background-color: #f3e5f5 !important;
}

.tt-gross-table tbody tr:hover .tt-gross-td-label {
  background-color: #f3e5f5 !important;
}

.tt-gross-table .tt-gross-td-metric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  color: #4a148c !important;
  font-weight: 500;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
  .tt-gross-wrap {
    margin: 1rem -1rem;
  }

  .tt-gross-table-wrap {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .tt-gross-table th,
  .tt-gross-table td {
    padding: 0.75rem 0.875rem;
    font-size: 13px;
  }

  .tt-gross-table .tt-gross-th-label,
  .tt-gross-table .tt-gross-td-label {
    min-width: 140px;
    max-width: 200px;
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
  }

  .tt-gross-table .tt-gross-th-metric {
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  .tt-gross-table th,
  .tt-gross-table td {
    padding: 0.625rem 0.75rem;
    font-size: 12px;
  }

  .tt-gross-table .tt-gross-th-label,
  .tt-gross-table .tt-gross-td-label {
    min-width: 100px;
    max-width: 140px;
  }

  .tt-gross-table .tt-gross-th-metric {
    min-width: 90px;
  }
}

/* Print Styles */
@media print {
  .tt-gross-table-wrap {
    box-shadow: none;
    border: 1px solid #000;
  }

  .tt-gross-table tbody tr:hover {
    background-color: transparent;
  }

  .tt-gross-td-label {
    position: static;
  }
}

/* Suppress all focus/tap artifacts on cards */
.tt-gross-table:focus-within,
.tt-gross-table:focus,
.tt-gross-card,
.tt-gross-card:focus,
.tt-gross-card:focus-within,
.tt-gross-card:focus-visible,
.tt-gross-card td,
.tt-gross-card td:focus,
.tt-gross-card td:focus-within,
.tt-gross-card td:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.tt-gross-card *,
.tt-gross-card *:focus,
.tt-gross-card *:focus-visible {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
  .tt-gross-wrap {
    color: #f9fafb;
  }

  .tt-gross-table-wrap {
    background: #1f2937;
    border-color: #374151;
  }

  .tt-gross-table thead {
    background: linear-gradient(to bottom, #111827, #1f2937);
    border-bottom-color: #374151;
  }

  .tt-gross-table th {
    color: #f3f4f6;
  }

  .tt-gross-th-label {
    background: linear-gradient(to bottom, #111827, #1f2937);
  }

  .tt-gross-table tbody tr {
    border-bottom-color: #374151;
  }

  .tt-gross-table tbody tr:hover {
    background-color: #374151;
  }

  .tt-gross-row-even {
    background-color: #1f2937;
  }

  .tt-gross-row-odd {
    background-color: #111827;
  }

  .tt-gross-table td {
    color: #f9fafb;
  }

  .tt-gross-td-label {
    border-right-color: #374151;
  }

  .tt-gross-row-even .tt-gross-td-label {
    background-color: #1f2937;
  }

  .tt-gross-row-odd .tt-gross-td-label {
    background-color: #111827;
  }

  /* Total row — dark mode */
  .tt-gross-row-total,
  .tt-gross-row-total.tt-gross-row-even,
  .tt-gross-row-total.tt-gross-row-odd {
    background-color: #2d1b69 !important;
    border-top: 2px solid #7c4dff;
  }

  .tt-gross-row-total td,
  .tt-gross-row-total .tt-gross-td-metric,
  .tt-gross-row-total .tt-gross-td-metric strong {
    color: #ffffff !important;
  }

  .tt-gross-row-total .tt-gross-td-label,
  .tt-gross-row-total .tt-gross-td-label strong {
    background-color: #2d1b69 !important;
    color: #e1bee7 !important;
  }

  .tt-gross-row-total .tt-gross-card-gross {
    color: #ffffff !important;
  }

  .tt-gross-row-total .tt-gross-card-occupancy {
    color: #ce93d8 !important;
  }

  .tt-gross-row-total .tt-gross-card-row-label {
    color: #b39ddb !important;
  }

  .tt-gross-row-total .tt-gross-card-row-value {
    color: #ffffff !important;
  }

  .tt-gross-table tbody tr.tt-gross-row-total:hover {
    background-color: #2d1b69 !important;
    transform: none;
  }

  .tt-gross-table tbody tr.tt-gross-row-total:hover .tt-gross-td-label {
    background-color: #2d1b69 !important;
  }

  .tt-gross-table tbody tr:hover .tt-gross-td-label {
    background-color: #374151;
  }

  .tt-gross-td-metric {
    color: #f3f4f6;
  }

  .tt-gross-loading,
  .tt-gross-empty {
    background: #1f2937;
    border-color: #374151;
  }

  .tt-gross-loading p,
  .tt-gross-empty p {
    color: #9ca3af;
  }

  .tt-gross-spinner {
    border-color: #374151;
    border-top-color: #60a5fa;
  }

  .tt-gross-error {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
  }

  .tt-gross-error strong {
    color: #fef2f2;
  }
}

/* ========================
   COMPACT STYLE
   ======================== */
.tt-gross-style-compact .tt-gross-table th,
.tt-gross-style-compact .tt-gross-table td {
  padding: 0.4rem 0.6rem;
  font-size: 12px;
}

.tt-gross-style-compact .tt-gross-th-label,
.tt-gross-style-compact .tt-gross-td-label {
  min-width: 120px;
}

.tt-gross-style-compact .tt-gross-th-metric {
  min-width: 80px;
}

.tt-gross-style-compact .tt-gross-table-wrap {
  box-shadow: none;
  border-width: 1px;
}

.tt-gross-style-compact .tt-gross-table thead {
  background: #673ab7;
  box-shadow: none;
}

/* Hide card elements on desktop for compact style */
.tt-gross-style-compact .tt-gross-card-primary,
.tt-gross-style-compact .tt-gross-card-secondary {
  display: none;
}

/* Force mobile layout when force_mobile="true" attribute is set */
/* Compact timestamp for force_mobile */
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-timestamp {
  padding: 0.25rem 0.5rem !important;
  margin-bottom: 0.5rem !important;
  font-size: 11px !important;
  border-radius: 5px !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table-wrap {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  overflow: hidden;
  box-sizing: border-box;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table thead {
  display: none;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table tbody {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table tbody tr {
  display: block;
  background: #fff;
  border: 1.5px solid #d1c4e9;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(103, 58, 183, 0.08);
  transform: none;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-table tbody tr:last-child {
  margin-bottom: 0 !important; /* remove trailing gap after final card */
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-primary,
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-secondary {
  display: block !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-td-metric {
  display: none !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-td-label {
  position: static !important;
  display: block !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #673ab7 !important;
  max-width: 100% !important;
  width: 100% !important;
  white-space: normal;
  word-break: break-word;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-td-label strong {
  display: block;
  padding-bottom: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-primary {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-bottom: none !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-expanded .tt-gross-card-primary {
  border-bottom: 1px solid #ede7f6 !important;
  padding-bottom: 6px !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-gross {
  font-size: 11px;
  font-weight: 700;
  color: #1f2937;
  flex: 0 1 auto;
  min-width: 0 !important;
  max-width: 55% !important;
  overflow: hidden !important;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-occupancy {
  font-size: 11px;
  font-weight: 600;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
  max-width: 40% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-occ-high {
  color: #059669;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-occ-medium {
  color: #d97706;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-occ-low {
  color: #dc2626;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-secondary {
  padding: 6px 0 0 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 11px;
  border-bottom: 1px solid #f3f4f6;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-row:last-child {
  border-bottom: none;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-row-label {
  color: #6b7280;
  font-weight: 500;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-row-value {
  color: #1f2937;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"] {
  cursor: pointer;
  user-select: none;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"]:active {
  transform: scale(0.995);
}

/* Ensure non-expandable cards are not interactive */
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card:not([data-has-secondary="true"]) {
  cursor: default;
  user-select: auto;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"] .tt-gross-card-primary::after {
  content: '▾';
  margin-left: 6px;
  font-size: 14px;
  color: #9575cd;
  transition: transform 0.25s ease;
  display: inline-block;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-card-expanded .tt-gross-card-primary::after {
  transform: rotate(180deg);
}

/* Total row card — force_mobile (light mode) */
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total {
  background: linear-gradient(135deg, #ede7f6, #f3e5f5) !important;
  border: 2px solid #673ab7 !important;
  border-radius: 8px !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label,
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label strong {
  color: #4a148c !important;
  background: none !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-gross {
  color: #1a1a1a !important;
}

.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total:hover,
.tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total:active {
  background: linear-gradient(135deg, #ede7f6, #f3e5f5) !important;
}

/* Total row card — force_mobile (dark mode) */
@media (prefers-color-scheme: dark) {
  .tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total {
    background: linear-gradient(135deg, #1a1a2e, #2d1b69) !important;
    border-color: #7c4dff !important;
  }

  .tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label,
  .tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label strong {
    color: #e1bee7 !important;
  }

  .tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-gross {
    color: #ffffff !important;
  }

  .tt-gross-force-mobile .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-occupancy {
    color: #ce93d8 !important;
  }
}

/* ========================
   MOBILE CARD LAYOUT (Compact Style)
   ======================== */
@media (max-width: 480px) {
  .tt-gross-wrap.tt-gross-style-compact {
    margin: 1rem 0;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Extra compact timestamp on mobile */
  .tt-gross-style-compact .tt-gross-timestamp {
    padding: 0.25rem 0.5rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 11px !important;
    border-radius: 5px !important;
  }

  .tt-gross-style-compact .tt-gross-table-wrap {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tt-gross-style-compact .tt-gross-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .tt-gross-style-compact .tt-gross-table thead {
    display: none !important;
  }

  .tt-gross-style-compact .tt-gross-table tbody {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .tt-gross-style-compact .tt-gross-table tbody tr {
    display: block !important;
    background: #fff;
    border: 1.5px solid #d1c4e9;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-shadow: 0 1px 4px rgba(103, 58, 183, 0.08);
    transform: none;
  }

  .tt-gross-style-compact .tt-gross-table tbody tr:last-child {
    margin-bottom: 0 !important; /* remove trailing gap after final card */
  }

  .tt-gross-style-compact .tt-gross-table tbody tr:hover {
    transform: none;
    background: #fff;
  }

  .tt-gross-style-compact .tt-gross-table tbody tr.tt-gross-row-total:hover {
    background: linear-gradient(135deg, #ede7f6, #f3e5f5) !important;
  }

  .tt-gross-style-compact .tt-gross-td-label {
    position: static !important;
    display: block !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    color: #673ab7 !important;
    max-width: 100% !important;
    width: 100% !important;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .tt-gross-style-compact .tt-gross-td-label strong {
    display: block;
    padding-bottom: 4px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
  }

  .tt-gross-style-compact .tt-gross-card-primary {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    border-bottom: none !important;
  }

  /* Only show border when card is expanded */
  .tt-gross-style-compact .tt-gross-card-expanded .tt-gross-card-primary {
    border-bottom: 1px solid #ede7f6 !important;
    padding-bottom: 6px !important;
  }

  .tt-gross-style-compact .tt-gross-card-gross {
    font-size: 11px;
    font-weight: 700;
    color: #1f2937;
    flex: 0 1 auto;
    min-width: 0 !important;
    max-width: 55% !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box !important;
  }

  .tt-gross-style-compact .tt-gross-card-occupancy {
    font-size: 11px;
    font-weight: 600;
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: right;
    max-width: 40% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .tt-gross-style-compact .tt-gross-occ-high {
    color: #059669;
  }

  .tt-gross-style-compact .tt-gross-occ-medium {
    color: #d97706;
  }

  .tt-gross-style-compact .tt-gross-occ-low {
    color: #dc2626;
  }

  .tt-gross-style-compact .tt-gross-card-secondary {
    padding: 6px 0 0 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .tt-gross-style-compact .tt-gross-card-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
    border-bottom: 1px solid #f3f4f6;
  }

  .tt-gross-style-compact .tt-gross-card-row:last-child {
    border-bottom: none;
  }

  .tt-gross-style-compact .tt-gross-card-row-label {
    color: #6b7280;
    font-weight: 500;
  }

  .tt-gross-style-compact .tt-gross-card-row-value {
    color: #1f2937;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  /* Expandable card indicator */
  .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"] {
    cursor: pointer;
    user-select: none;
  }

  .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"]:active {
    transform: scale(0.995);
  }
  
  /* Ensure non-expandable cards are not interactive */
  .tt-gross-style-compact .tt-gross-card:not([data-has-secondary="true"]) {
    cursor: default;
    user-select: auto;
  }

  /* Add chevron indicator to expandable cards */
  .tt-gross-style-compact .tt-gross-card[data-has-secondary="true"] .tt-gross-card-primary::after {
    content: '▾';
    margin-left: 6px;
    font-size: 14px;
    color: #9575cd;
    transition: transform 0.25s ease;
    display: inline-block;
  }

  .tt-gross-style-compact .tt-gross-card-expanded .tt-gross-card-primary::after {
    transform: rotate(180deg);
  }

  /* Hide all td elements except the first (movie name) */
  .tt-gross-style-compact .tt-gross-td-metric {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  /* Ensure all elements respect container width */
  .tt-gross-style-compact .tt-gross-card-primary,
  .tt-gross-style-compact .tt-gross-card-primary *,
  .tt-gross-style-compact .tt-gross-td-label,
  .tt-gross-style-compact .tt-gross-td-label * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Total row card — mobile compact (light mode) */
  .tt-gross-style-compact .tt-gross-row-total {
    background: linear-gradient(135deg, #ede7f6, #f3e5f5) !important;
    border: 2px solid #673ab7 !important;
    border-radius: 8px !important;
  }

  .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label,
  .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label strong {
    color: #4a148c !important;
    background: none !important;
  }

  .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-gross {
    color: #1a1a1a !important;
  }
}

/* Total row card — mobile compact (dark mode) */
@media (max-width: 480px) and (prefers-color-scheme: dark) {
  .tt-gross-style-compact .tt-gross-row-total {
    background: linear-gradient(135deg, #1a1a2e, #2d1b69) !important;
    border-color: #7c4dff !important;
  }

  .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label,
  .tt-gross-style-compact .tt-gross-row-total .tt-gross-td-label strong {
    color: #e1bee7 !important;
  }

  .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-gross {
    color: #ffffff !important;
  }

  .tt-gross-style-compact .tt-gross-row-total .tt-gross-card-occupancy {
    color: #ce93d8 !important;
  }
}
