body.tt-canvas-app {
  background: radial-gradient(circle at top, #202b3a 0%, #0a0f18 70%);
  color: #ffffff;
  font-family: "Inter", "Roboto", sans-serif;
  min-height: 100vh;
}

#tt-active-list {
  color: #ffffff;
}

.tt-wrap {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  border-radius: 28px;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 25px 80px rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.tt-wrap-full {
  max-width: none;
  width: 100%;
  margin: 2rem 0;
  border-radius: 0;
}

@media (max-width: 1024px) {
  .tt-wrap-full {
    margin: 1rem 0;
  }
}

.tt-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 20%, rgba(76, 201, 240, 0.2), transparent 50%),
    radial-gradient(circle at 80% 0%, rgba(255, 99, 146, 0.25), transparent 45%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
  position: relative;
  z-index: 2;
}

.tt-header h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 600;
  color: #f8fafc;
}

.tt-admin-subtitle {
  margin: 0;
  color: #ffffff;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* Ensure admin subtitle stays white even though .tt-subtitle sets gray */
.tt-subtitle.tt-admin-subtitle {
  color: #ffffff !important;
}

.tt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.5rem 1.3rem;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  gap: 0.35rem;
}

.tt-btn-primary {
  background: linear-gradient(120deg, #6dd5fa, #2979ff);
  color: #fff;
  font-weight: 600;
}

.tt-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(41, 121, 255, 0.3);
}

.tt-btn-danger {
  background: #ef4444;
  color: #fff;
}

.tt-btn-danger:hover {
  background: #dc2626;
}

.tt-scan-now-btn {
  width: 100%;
  margin-top: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 14px;
  background: linear-gradient(120deg, #f97316, #ec4899);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(236, 72, 153, 0.35);
}

#tt-start-scan-btn,
#tt-end-scan-btn {
  color: #ffffff;
}

.tt-scan-now-btn.is-scanning {
  animation: ttScanPulse 1.2s ease-out infinite;
  background: linear-gradient(120deg, #ec4899, #8b5cf6);
}

.tt-scan-now-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.4), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tt-scan-now-btn:hover::after {
  opacity: 1;
}

.tt-scan-now-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

@keyframes ttScanPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.6);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(236, 72, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0);
  }
}

.tt-btn-link {
  background: linear-gradient(130deg, #f43f5e, #be123c);
  color: #ffffff;
  border: none;
  padding: 0.52rem 1.4rem;
  font-weight: 600;
  box-shadow: 0 12px 24px rgba(190, 18, 60, 0.4);
}

.tt-btn-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(190, 18, 60, 0.55);
  filter: brightness(1.05);
}

.tt-btn-link:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(190, 18, 60, 0.55);
}

.tt-active-sessions h3,
.tt-new-session-panel h3,
.tt-end-session-panel h3 {
  margin-top: 0;
}

.tt-divider {
  height: 1px;
  margin: 2rem 0;
  background: linear-gradient(to right, rgba(15, 23, 36, 0), rgba(99, 179, 237, 0.35), rgba(29, 185, 188, 0.6), rgba(15, 23, 36, 0));
}

.tt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .tt-grid {
    grid-template-columns: 1fr;
  }
}

.tt-qr-reader {
  width: 100%;
  min-height: 280px;
  border-radius: 24px;
  overflow: hidden;
  background: #030712;
  border: 1px solid rgba(93, 169, 250, 0.45);
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.8);
  position: relative;
}

.tt-qr-reader::before {
  content: "";
  position: absolute;
  inset: 20px;
  border: 2px dashed rgba(99, 179, 237, 0.7);
  border-radius: 18px;
  pointer-events: none;
  animation: ttScanFrame 2.5s linear infinite;
}

@keyframes ttScanFrame {
  0% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.2;
  }
}

.tt-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.6);
  color: #f8fafc;
}

.tt-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.8);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

.tt-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.tt-checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #ffffff;
}

.tt-new-session-panel label,
.tt-end-session-panel label,
.tt-edit-session-panel label {
  color: #ffffff;
}

.tt-edit-session-panel label strong {
  color: #ffffff;
}

.tt-message {
  margin-top: 0.6rem;
  font-size: 0.95rem;
}

.tt-success {
  color: #34d399;
}

.tt-error {
  color: #ef4444 !important;
  font-weight: bold;
}

.tt-hint {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

.tt-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
}

.tt-login-wrap .tt-subtitle {
  color: #e2e8f0;
}

.tt-login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .tt-login-grid {
    grid-template-columns: 1fr;
  }
}

.tt-login-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(99, 179, 237, 0.25);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 25px 45px rgba(2, 6, 23, 0.55);
}

#tt-login-form p {
  margin-bottom: 1rem;
}

#tt-login-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #e2e8f0;
}

#tt-login-form input[type="text"],
#tt-login-form input[type="password"] {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.65);
  color: #f8fafc;
}

#tt-login-form input[type="text"]:focus,
#tt-login-form input[type="password"]:focus {
  outline: none;
  border-color: rgba(99, 179, 237, 0.65);
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.35);
}

#tt-login-submit {
  width: 100%;
  background: linear-gradient(120deg, #6dd5fa, #2979ff);
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 12px 25px rgba(41, 121, 255, 0.25);
}

#tt-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(41, 121, 255, 0.35);
}

.tt-login-side {
  background: rgba(8, 47, 73, 0.3);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 20px;
  padding: 1.4rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(15, 23, 42, 0.6);
}

.tt-login-side h3 {
  margin: 0;
  color: #f8fafc;
}

.tt-login-side p {
  margin: 0;
  color: #cbd5f5;
}

.tt-login-home-btn {
  align-self: flex-start;
}

/* Cards */

.tt-session-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tt-session-list p {
  color: #ffffff;
}

.tt-card {
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.9));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.6);
}

.tt-card-admin {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tt-card-admin::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 55%);
  pointer-events: none;
}

.tt-card-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.tt-card-main-admin {
  align-items: flex-start;
  gap: 1.8rem;
}

.tt-admin-tabs {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.tt-tab-btn {
  border-radius: 14px;
  padding: 0.55rem 1.6rem;
  border: 1px solid rgba(244, 63, 94, 0.7);
  background: transparent;
  color: #fecaca;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tt-tab-btn.is-active {
  background: linear-gradient(130deg, #f43f5e, #ec4899);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(190, 18, 60, 0.45);
}

.tt-tab-btn:not(.is-active):hover {
  color: #ffe4e6;
  background: rgba(127, 29, 29, 0.45);
}

.tt-admin-tab-panels {
  margin-top: 0.5rem;
}

.tt-admin-tab-panel {
  display: none;
}

.tt-admin-tab-panel.is-active {
  display: block;
}

@media (max-width: 640px) {
  .tt-admin-tabs {
    gap: 0.5rem;
  }

  .tt-tab-btn {
    flex: 1 1 100%;
    text-align: center;
  }
}

.tt-admin-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.tt-admin-column-left {
  flex: 2 1 0;
  min-width: 0;
}

.tt-admin-column-right {
  flex: 1 1 0;
  min-width: 260px;
  max-width: 380px;
}

@media (max-width: 1024px) {
  .tt-admin-layout {
    flex-direction: column;
  }

  .tt-admin-column-right {
    max-width: none;
    width: 100%;
  }
}

.tt-card-left {
  flex: 1;
  position: relative;
  z-index: 2;
}

.tt-card-title {
  font-weight: 600;
  color: #f8fafc;
  font-size: 1.05rem;
}

.tt-user-full-name {
  font-weight: 600;
  margin-right: 0.35rem;
}

.tt-user-username {
  font-size: 0.95rem;
  color: #cbd5f5;
}

.tt-card-meta {
  font-size: 0.9rem;
  color: #cbd5f5;
}

.tt-therapy-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
}

.tt-chip-pill {
  border-radius: 999px;
  padding-inline: 1rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tt-chip-status {
  background: linear-gradient(135deg, #4ade80, #16a34a);
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.35);
}

.tt-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.15);
  border: 1px solid rgba(99, 179, 237, 0.4);
  color: #ffffff;
  font-size: 0.8rem;
}

.tt-chip-empty {
  border-color: rgba(148, 163, 184, 0.3);
  background: rgba(148, 163, 184, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.tt-card-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.6rem;
}

.tt-card-actions-admin {
  justify-content: center;
  gap: 0.6rem;
}

.tt-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 1rem;
}

.tt-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.tt-meta-block {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
}

.tt-meta-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  display: block;
  margin-bottom: 0.2rem;
}

.tt-meta-value {
  font-size: 0.95rem;
  color: #f8fafc;
  font-weight: 600;
}

.tt-live-duration {
  font-weight: 600;
  color: #22d3ee;
}

.tt-warning {
  color: #b91c1c;
  padding: 0.75rem 1rem;
  background: #fee2e2;
  border-radius: 8px;
}

@media (max-width: 640px) {
  html,
  body {
    overflow-x: hidden;
  }

  .tt-wrap {
    margin: 1rem auto;
    padding: 1.3rem;
    border-radius: 20px;
  }

  .tt-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .tt-grid {
    grid-template-columns: 1fr;
  }

  .tt-qr-reader {
    min-height: 220px;
  }

  .tt-card-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .tt-card-main-admin {
    flex-direction: column;
  }

  .tt-card-meta-grid {
    grid-template-columns: 1fr;
  }

  .tt-badge-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tt-card-actions-admin {
    width: 100%;
    align-items: flex-start;
  }

  .tt-card-left,
  .tt-meta-block,
  .tt-therapy-chip-list {
    width: 100%;
  }

  /* Make primary text blocks inside cards span full width on mobile */
  .tt-card-main > div,
  .tt-card-title,
  .tt-card-meta {
    width: 100%;
  }
}

/* Reports Page Styles */
.tt-reports-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.2);
  padding-bottom: 0;
}

.tt-reports-tabs .tt-tab-btn {
  border-radius: 8px 8px 0 0;
  padding: 12px 24px;
  border: none;
  background: transparent;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tt-reports-tabs .tt-tab-btn:hover {
  color: #0f172a;
  background: rgba(59, 130, 246, 0.1);
}

.tt-reports-tabs .tt-tab-btn.is-active {
  color: #0f172a;
  background: rgba(59, 130, 246, 0.2);
  border-bottom-color: rgba(59, 130, 246, 0.8);
}

.tt-tab-panel {
  display: none;
}

.tt-tab-panel.is-active {
  display: block;
}

.tt-reports-container {
  max-width: 1200px;
  margin-top: 20px;
}

.tt-reports-header {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.6);
}

.tt-reports-form {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.tt-reports-header label {
  color: #f8fafc;
  font-weight: 600;
}

.tt-reports-header select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 200px;
  font-size: 14px;
}

.tt-reports-header select:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.8);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

.tt-date-input {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f8fafc;
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 200px;
  font-size: 14px;
}

.tt-date-input:focus {
  outline: none;
  border-color: rgba(129, 140, 248, 0.8);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.35);
}

.tt-date-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.tt-reports-content {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.9));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 18px;
  padding: 25px;
  box-shadow: 0 12px 35px rgba(2, 6, 23, 0.6);
}

.tt-reports-content h2 {
  color: #f8fafc;
  margin-top: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.tt-reports-empty {
  color: #cbd5f5;
  font-size: 14px;
  margin-top: 15px;
}

.tt-reports-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
}

.tt-reports-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.tt-reports-table thead {
  background: rgba(59, 130, 246, 0.2);
}

.tt-reports-table th {
  padding: 15px;
  text-align: left;
  color: #f8fafc;
  font-weight: 600;
  border-bottom: 2px solid rgba(59, 130, 246, 0.4);
}

.tt-reports-table .tt-text-center {
  text-align: center;
}

.tt-reports-table td {
  padding: 12px 15px;
  color: #cbd5f5;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.tt-reports-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.1);
}

.tt-reports-table tfoot {
  background: rgba(59, 130, 246, 0.15);
  font-weight: 600;
}

.tt-reports-table tfoot td {
  color: #f8fafc;
  border-top: 2px solid rgba(59, 130, 246, 0.4);
}

.tt-reports-table .tt-hours {
  font-weight: 600;
  color: #22d3ee;
}

@media (max-width: 768px) {
  .tt-reports-form {
    flex-direction: column;
    align-items: stretch;
  }

  .tt-reports-header select {
    width: 100%;
  }

  .tt-reports-table-wrapper {
    font-size: 0.9rem;
  }

  .tt-reports-table th,
  .tt-reports-table td {
    padding: 8px;
  }
}

/* Export Buttons */
.tt-export-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tt-export-btn {
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.tt-export-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .tt-reports-content > div:first-child {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 15px;
  }

  .tt-export-buttons {
    width: 100%;
  }

  .tt-export-btn {
    flex: 1;
    text-align: center;
  }
}
