/* ============================================================
   Studio Labs — Client Dashboard
   Full app layout: sidebar + content, dark professional theme
   ============================================================ */

/* ---- Body override ---- */
.dashboard-body {
  background: var(--dark);
  overflow-x: hidden;
}

/* ============================================================
   DASHBOARD NAV
   ============================================================ */
.dash-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 56px;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
}

.dash-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 24px;
  gap: 20px;
}

.dash-nav-center {
  display: flex;
  align-items: center;
  gap: 2px;
}

.dash-nav-tab {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font-body);
  transition: all var(--transition);
}

.dash-nav-tab:hover  { color: var(--text); background: var(--dark-hover); }
.dash-nav-tab.active { color: var(--white); background: var(--dark-card); }

.dash-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 100px;
}

.dash-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-user-pill span {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 500;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-signout-btn {
  background: none;
  border: 1px solid var(--dark-border);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-body);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.dash-signout-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.dash-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  padding-top: 56px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.dash-sidebar {
  background: var(--dark-surface);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 12px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.dash-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--transition);
  position: relative;
}

.dash-sidebar-item:hover  { color: var(--text); background: var(--dark-hover); }
.dash-sidebar-item.active { color: var(--white); background: var(--dark-card); }
.dash-sidebar-item.active { border-left: 3px solid var(--primary); padding-left: 9px; }

.dash-sidebar-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.dash-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}

.dash-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--dark-border);
}

.dash-sidebar-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-body);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: color var(--transition);
  text-decoration: none;
  display: block;
}

.dash-sidebar-link:hover { color: var(--text); }

/* ============================================================
   CONTENT AREA
   ============================================================ */
.dash-content {
  padding: 40px 48px;
  min-height: calc(100vh - 56px);
}

/* Tabs */
.dash-tab { display: none; }
.dash-tab.active { display: block; }

/* Tab header */
.dash-tab-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
}

.dash-tab-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
}

.dash-tab-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.dash-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 4px;
}

/* Section title (within a tab) */
.dash-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* Empty state */
.dash-empty-state {
  text-align: center;
  padding: 40px 24px;
  background: var(--dark-card);
  border: 1px dashed var(--dark-border);
  border-radius: var(--radius);
}

.dash-empty-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.dash-empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ============================================================
   STATS ROW
   ============================================================ */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.dash-stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dash-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.dash-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   PROJECT CARD
   ============================================================ */
.project-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition);
}

.project-card--featured {
  border-color: rgba(108,99,255,0.35);
  box-shadow: 0 0 0 1px rgba(108,99,255,0.08);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.project-type-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: rgba(108,99,255,0.1);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
}

.project-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 480px;
}

.project-status-pill {
  padding: 5px 14px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.status--in-progress {
  background: rgba(245,158,11,0.12);
  color: #FCD34D;
  border: 1px solid rgba(245,158,11,0.25);
}

.status--complete {
  background: rgba(34,197,94,0.12);
  color: #86EFAC;
  border: 1px solid rgba(34,197,94,0.25);
}

.status--pending {
  background: rgba(148,148,168,0.1);
  color: var(--text-muted);
  border: 1px solid var(--dark-border);
}

.status--unpaid {
  background: rgba(239,68,68,0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239,68,68,0.25);
}

.status--paid {
  background: rgba(34,197,94,0.12);
  color: #86EFAC;
  border: 1px solid rgba(34,197,94,0.25);
}

/* Timeline */
.project-timeline {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  gap: 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--dark-border);
  border: 2px solid var(--dark-border);
  transition: all 0.3s ease;
}

.timeline-line {
  flex: 1;
  height: 2px;
  background: var(--dark-border);
  transition: background 0.3s ease;
  margin-bottom: 20px;
}

.timeline-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.timeline-step.done .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px rgba(0,212,170,0.4);
}

.timeline-step.done .timeline-label  { color: var(--accent); }
.timeline-line.done { background: var(--accent); }

.timeline-step.active .timeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(108,99,255,0.5);
  animation: pulse-step 2s infinite;
}

.timeline-step.active .timeline-label { color: var(--primary); font-weight: 600; }

@keyframes pulse-step {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,99,255,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(108,99,255,0); }
}

/* Project meta */
.project-meta {
  display: flex;
  gap: 32px;
  padding: 16px 0;
  border-top: 1px solid var(--dark-border);
  border-bottom: 1px solid var(--dark-border);
  margin-bottom: 20px;
}

.project-meta-label {
  display: block;
  font-size: 0.73rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.project-meta-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.project-card-footer {
  display: flex;
  gap: 10px;
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.quick-action-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.quick-action-card:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.04);
  transform: translateY(-2px);
}

.quick-action-icon {
  font-size: 1.6rem;
}

.quick-action-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.quick-action-card:hover .quick-action-label { color: var(--text); }

/* ============================================================
   INVOICES
   ============================================================ */
.invoice-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.invoice-card--unpaid {
  border-left: 3px solid var(--warning);
}

.invoice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.invoice-id {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.invoice-desc {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.invoice-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  flex-shrink: 0;
}

.invoice-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.invoice-due {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.invoice-footer {
  display: flex;
  gap: 10px;
}

/* ============================================================
   MESSAGES
   ============================================================ */
.message-thread {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
}

.message-item {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.message-item--client {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.message-avatar--team {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.message-avatar--client {
  background: var(--dark-hover);
  color: var(--text-muted);
  border: 1px solid var(--dark-border);
}

.message-bubble {
  max-width: 520px;
  background: var(--dark-hover);
  border: 1px solid var(--dark-border);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 16px;
}

.message-bubble--client {
  background: rgba(108,99,255,0.1);
  border-color: rgba(108,99,255,0.2);
  border-radius: 16px 16px 4px 16px;
}

.message-sender {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.message-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
}

.message-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 6px;
}

.message-compose {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 16px;
}

.message-compose textarea {
  width: 100%;
  background: var(--dark-hover);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
}

.message-compose textarea:focus {
  border-color: var(--primary);
}

.message-compose textarea::placeholder { color: var(--text-dim); }

.message-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.message-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ============================================================
   FILES
   ============================================================ */
.file-drop-zone {
  border: 2px dashed var(--dark-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--dark-card);
  margin-bottom: 24px;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(108,99,255,0.04);
}

.file-drop-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.file-drop-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.file-drop-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.file-row-icon { font-size: 1.2rem; }

.file-row-info { flex: 1; min-width: 0; }

.file-row-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-row-status {
  font-size: 0.75rem;
  color: var(--warning);
  white-space: nowrap;
}

.file-row-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition);
}

.file-row-remove:hover { color: var(--danger); }

/* ============================================================
   SUPPORT
   ============================================================ */
.support-form-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
}

.support-form-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .dash-stats        { grid-template-columns: repeat(2, 1fr); }
  .quick-actions     { grid-template-columns: repeat(2, 1fr); }
  .dash-nav-center   { display: none; }
  .dash-content      { padding: 32px 28px; }
}

@media (max-width: 768px) {
  .dash-layout          { grid-template-columns: 1fr; }
  .dash-sidebar         { display: none; }
  .dash-stats           { grid-template-columns: repeat(2, 1fr); }
  .dash-tab-header      { flex-direction: column; }
  .dash-header-actions  { width: 100%; }
  .project-card-header  { flex-direction: column; }
  .project-meta         { flex-direction: column; gap: 12px; }
  .invoice-header       { flex-direction: column; }
  .message-thread       { max-height: 300px; }
  .dash-content         { padding: 24px 16px; }
  .dash-nav-right .dash-user-pill span { display: none; }
}
