/* ═══════════════════════════════════════════════════════════
   ZTUDY UNIFIED DASHBOARD WITH LIVE CURSORS
   ═══════════════════════════════════════════════════════════ */

.zt-dashboard-wrapper {
  position: relative;
  margin-top: 16px;
}

/* Dashboard Container */
.zt-dashboard {
  position: relative;
  background: linear-gradient(135deg, rgba(20, 24, 40, 0.95) 0%, rgba(15, 18, 32, 0.95) 100%);
  border: 1px solid rgba(0, 229, 160, 0.15);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 229, 160, 0.08);
  animation: slideInUp 0.7s ease-out 0.3s both;
  height: 520px;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.zt-dashboard__topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 229, 160, 0.1);
  background: rgba(0, 0, 0, 0.2);
  gap: 20px;
  flex-shrink: 0;
  height: 48px;
}

.zt-dashboard__topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.zt-dashboard__brand {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
}

.zt-dashboard__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.zt-dashboard__branch {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.zt-dashboard__topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.zt-dashboard__date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.zt-dashboard__users-live {
  font-size: 0.85rem;
  color: rgba(0, 229, 160, 0.9);
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(0, 229, 160, 0.1);
  border-radius: 4px;
  animation: pulse 2s ease-in-out infinite;
}

/* Main Content */
.zt-dashboard__main {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

/* Sidebar Navigation */
.zt-dashboard__sidebar {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 0;
  border-right: 1px solid rgba(0, 229, 160, 0.1);
  display: flex;
  flex-direction: column;
}

.zt-dashboard__nav-item {
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
}

.zt-dashboard__nav-item:hover {
  background: rgba(0, 229, 160, 0.05);
  color: rgba(255, 255, 255, 0.7);
}

.zt-dashboard__nav-item--active {
  background: rgba(0, 229, 160, 0.1);
  color: #00e5a0;
  border-left: 2px solid #00e5a0;
  padding-left: 10px;
}

.zt-dashboard__nav-item svg {
  flex-shrink: 0;
}

/* Content Area */
.zt-dashboard__content {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}

/* Stats Cards */
.zt-dashboard__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex-shrink: 0;
  height: 88px;
}

.zt-dashboard__stat {
  background: rgba(0, 229, 160, 0.05);
  border: 1px solid rgba(0, 229, 160, 0.15);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.zt-dashboard__stat:hover {
  background: rgba(0, 229, 160, 0.1);
  border-color: rgba(0, 229, 160, 0.3);
  transform: translateY(-2px);
}

.zt-dashboard__stat--green {
  background: rgba(0, 229, 160, 0.08);
  border-color: rgba(0, 229, 160, 0.3);
}

.zt-dashboard__stat--green:hover {
  background: rgba(0, 229, 160, 0.15);
  border-color: rgba(0, 229, 160, 0.5);
}

.zt-dashboard__stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #00e5a0;
  margin-bottom: 6px;
  line-height: 1;
}

.zt-dashboard__stat--green .zt-dashboard__stat-val {
  color: #00e5a0;
}

.zt-dashboard__stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chart */
.zt-dashboard__chart {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
  height: 120px;
  display: flex;
  flex-direction: column;
}

.zt-dashboard__chart-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
}

.zt-dashboard__chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 100px;
  gap: 8px;
  margin-bottom: 12px;
}

.zt-dashboard__bar {
  flex: 1;
  background: linear-gradient(180deg, rgba(0, 229, 160, 0.6) 0%, rgba(0, 229, 160, 0.2) 100%);
  border-radius: 4px 4px 0 0;
  transition: all 0.3s ease;
  min-height: 20px;
}

.zt-dashboard__bar:hover {
  background: linear-gradient(180deg, rgba(0, 229, 160, 0.8) 0%, rgba(0, 229, 160, 0.3) 100%);
}

.zt-dashboard__bar--hi {
  background: linear-gradient(180deg, rgba(0, 229, 160, 0.9) 0%, rgba(0, 229, 160, 0.4) 100%);
}

.zt-dashboard__chart-months {
  display: flex;
  justify-content: space-around;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
  gap: 8px;
}

.zt-dashboard__chart-months span {
  flex: 1;
  text-align: center;
}

/* Table */
.zt-dashboard__table {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.85rem;
  flex: 1;
  overflow-y: auto;
  flex-shrink: 1;
  min-height: 120px;
}

.zt-dashboard__table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  gap: 12px;
  padding: 8px 0;
  align-items: center;
  border-bottom: 1px solid rgba(0, 229, 160, 0.05);
}

.zt-dashboard__table-row:last-child {
  border-bottom: none;
}

.zt-dashboard__table-row--head {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  padding-bottom: 12px;
}

.zt-dashboard__table-pill {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  display: block;
}

.zt-dashboard__table-pill--name {
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 229, 160, 0.2);
}

.zt-dashboard__table-pill--w60 {
  width: 60%;
}

.zt-dashboard__table-pill--w70 {
  width: 70%;
}

.zt-dashboard__table-pill--w80 {
  width: 80%;
}

.zt-dashboard__table-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

.zt-dashboard__table-badge--green {
  background: rgba(34, 197, 94, 0.2);
  color: rgba(34, 197, 94, 0.9);
}

.zt-dashboard__table-badge--orange {
  background: rgba(255, 159, 64, 0.2);
  color: rgba(255, 159, 64, 0.9);
}

/* Live Cursors */
.zt-cursor {
  position: absolute;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
  will-change: left, top, transform;
  visibility: visible;
  opacity: 1;
  transition: transform 0.15s ease-out;
}

.zt-cursor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: white;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.zt-cursor--principal .zt-cursor__dot {
  box-shadow: 0 0 6px rgba(102, 126, 234, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.6);
}

.zt-cursor--teacher .zt-cursor__dot {
  box-shadow: 0 0 6px rgba(245, 87, 108, 0.8), inset 0 0 4px rgba(255, 255, 255, 0.6);
}

.zt-cursor__label {
  position: absolute;
  top: -20px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  letter-spacing: 0.3px;
}

.zt-cursor--principal .zt-cursor__label {
  border-color: rgba(102, 126, 234, 0.2);
}

.zt-cursor--teacher .zt-cursor__label {
  border-color: rgba(245, 87, 108, 0.2);
}

/* Toasts */
.zt-toasts {
  position: absolute;
  top: -60px;
  right: 16px;
  z-index: 200;
  max-width: 280px;
}

.zt-toast {
  background: rgba(34, 197, 94, 0.95);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-left: 3px solid #22c55e;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.75rem;
  backdrop-filter: blur(10px);
  animation: slideInRight 0.3s ease-out;
  line-height: 1.3;
}

.zt-toast.dismiss {
  animation: slideOutRight 0.3s ease-out forwards;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(360px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(360px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes clickPulse {
  0% {
    box-shadow: 0 0 12px rgba(0, 229, 160, 0.4);
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0px rgba(0, 229, 160, 0);
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .zt-dashboard {
    height: 420px;
  }

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

  .zt-dashboard__main {
    grid-template-columns: 140px 1fr;
  }

  .zt-dashboard__nav-item {
    font-size: 0.75rem;
    padding: 8px 10px;
  }
}

@media (max-width: 768px) {
  .zt-dashboard-wrapper {
    display: none;
  }

  .zt-dashboard {
    height: 340px;
  }

  .zt-dashboard__main {
    grid-template-columns: 1fr;
  }

  .zt-dashboard__sidebar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-right: none;
    border-bottom: 1px solid rgba(0, 229, 160, 0.1);
  }

  .zt-dashboard__nav-item {
    flex-direction: column;
    padding: 8px 6px;
    font-size: 0.65rem;
    text-align: center;
  }

  .zt-dashboard__stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .zt-dashboard__stat {
    padding: 12px;
  }

  .zt-dashboard__stat-value {
    font-size: 0.95rem;
  }

  .zt-dashboard__stat-label {
    font-size: 0.65rem;
  }

  .zt-dashboard__topbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    height: auto;
  }

  .zt-dashboard__topbar-left,
  .zt-dashboard__topbar-right {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .zt-dashboard__content {
    padding: 12px;
    gap: 12px;
    overflow-y: auto;
  }

  .zt-toasts {
    top: -50px;
    right: 12px;
    left: auto;
    max-width: 240px;
  }

  .zt-toast {
    padding: 6px 10px;
    font-size: 0.7rem;
    margin-bottom: 6px;
  }

  .zt-cursor {
    display: none;
  }

  .zt-cursor__label {
    display: none;
  }
}

@media (max-width: 480px) {
  .zt-dashboard {
    height: 320px;
    border-radius: 12px;
  }

  .zt-dashboard__topbar {
    padding: 8px 12px;
    height: auto;
  }

  .zt-dashboard__brand {
    font-size: 0.9rem;
  }

  .zt-dashboard__title {
    font-size: 0.75rem;
    padding-left: 8px;
  }

  .zt-dashboard__stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .zt-dashboard__stat {
    padding: 10px;
  }

  .zt-dashboard__stat-value {
    font-size: 0.85rem;
  }

  .zt-dashboard__stat-label {
    font-size: 0.6rem;
  }

  .zt-dashboard__content {
    padding: 10px;
    gap: 10px;
  }
}

/* ═══ INTERACTIVE CONTENT TRANSITIONS ════════════════════════ */
.zt-dashboard__content {
  transition: opacity 0.3s ease;
}

.zt-dashboard__stat,
.zt-dashboard__chart-label {
  transition: all 0.3s ease;
}

.zt-dashboard__nav-item {
  cursor: pointer;
  transition: all 0.2s ease;
}

.zt-dashboard__nav-item:hover {
  background: rgba(0, 229, 160, 0.08);
  color: #00e5a0;
}

.zt-dashboard__nav-item:active {
  transform: scale(0.98);
}

/* Toast Styling */
.zt-toast {
  animation: slideInRight 0.3s ease-out;
}

.zt-toast.dismiss {
  animation: slideOutRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}
