/* ============================================================
   DASHBOARD — v4.2 Premium Hub Overhaul
   ============================================================
   Source: css/styles.css lines 2236-2590
   ============================================================ */

/* Fade-in animation for dashboard sections */
@keyframes hubFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hub-animate {
  animation: hubFadeUp 0.4s ease-out both;
}
.hub-animate-d1 { animation-delay: 0.05s; }
.hub-animate-d2 { animation-delay: 0.10s; }
.hub-animate-d3 { animation-delay: 0.15s; }
.hub-animate-d4 { animation-delay: 0.20s; }
.hub-animate-d5 { animation-delay: 0.25s; }
.hub-animate-d6 { animation-delay: 0.30s; }

/* Revenue hero card */
.hub-revenue-hero {
  background: linear-gradient(135deg, var(--navy-light) 0%, rgba(212,175,55,0.08) 100%);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.hub-revenue-big {
  font-family: 'Cinzel', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.hub-revenue-sub {
  font-size: 0.82rem;
  color: var(--gray-300);
  margin-top: 0.25rem;
}
.hub-revenue-compare {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}
.hub-revenue-compare.up {
  background: rgba(34,197,94,0.12);
  color: #22c55e;
}
.hub-revenue-compare.down {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}
.hub-revenue-compare.flat {
  background: rgba(156,163,175,0.12);
  color: var(--gray-400);
}

/* Monthly revenue bar chart */
.hub-month-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  margin-top: 1rem;
  padding-top: 0.25rem;
}
.hub-month-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.hub-month-bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--gold), var(--gold-dim));
  transition: height 0.6s ease-out;
  position: relative;
}
.hub-month-bar.current {
  background: linear-gradient(180deg, #22c55e, #16a34a);
}
.hub-month-bar-label {
  font-size: 0.58rem;
  color: var(--gray-500);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.hub-month-bar-val {
  font-size: 0.55rem;
  color: var(--champagne);
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}
.hub-month-bar-wrap:hover .hub-month-bar-val {
  opacity: 1;
}

/* Outstanding invoices alert strip */
.hub-outstanding-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  margin-top: 0.75rem;
  cursor: pointer;
  transition: background 0.2s;
}
.hub-outstanding-strip:hover {
  background: rgba(239,68,68,0.14);
}
.hub-outstanding-strip.clear {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.15);
}

/* Revenue by client mini-list */
.hub-client-rev-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--navy-lighter);
  font-size: 0.78rem;
}
.hub-client-rev-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--gold);
  margin-top: 2px;
  transition: width 0.5s ease-out;
}

/* Quick stats row */
.hub-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.hub-stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.75rem 0.5rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.hub-stat-card:hover {
  border-color: rgba(212,175,55,0.25);
  box-shadow: var(--card-hover-shadow);
}
.hub-stat-val {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}
.hub-stat-label {
  font-size: 0.68rem;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 0.15rem;
}

/* Active work section */
.hub-active-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.hub-active-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  box-shadow: var(--card-shadow);
}
.hub-active-card-title {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hub-active-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--champagne);
  background: var(--navy);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: 'Cinzel', serif;
}
.hub-job-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--navy-lighter);
  font-size: 0.78rem;
  cursor: pointer;
  border-left: 3px solid transparent;
  padding-left: 0.4rem;
  transition: background 0.15s, border-color 0.15s;
}
.hub-job-item:hover {
  background: rgba(212,175,55,0.06);
  border-left-color: var(--gold);
}
.hub-job-item:last-child { border-bottom: none; }

/* Quick actions bar */
.hub-quick-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.hub-action-btn {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  border: none;
  text-decoration: none;
  color: white;
}
.hub-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.hub-action-btn:active {
  transform: translateY(0);
}
.hub-action-btn.gold {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--navy);
}
.hub-action-btn.green {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.hub-action-btn.blue {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.hub-action-btn.purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

/* Dormancy widget placeholder */
#dormancy-widget {
  min-height: 20px;
}

/* Schedule widget on hub */
.hub-schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--navy-lighter);
  font-size: 0.78rem;
}
.hub-schedule-item:last-child { border-bottom: none; }
.hub-schedule-time {
  font-weight: 600;
  color: var(--gold);
  font-size: 0.72rem;
  min-width: 52px;
}

/* Section divider for hub */
.hub-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--gold-dim);
  opacity: 0.8;
}

/* Responsive overrides for hub */
@media (max-width: 768px) {
  .hub-quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .hub-active-grid {
    grid-template-columns: 1fr;
  }
  .hub-revenue-big {
    font-size: 1.8rem;
  }
  .hub-quick-actions {
    flex-direction: column;
  }
  .hub-action-btn {
    min-width: unset;
  }
  .hub-month-chart {
    height: 60px;
  }
}
@media (max-width: 480px) {
  .hub-quick-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }
  .hub-stat-card {
    padding: 0.5rem 0.3rem;
  }
  .hub-stat-val {
    font-size: 1.2rem;
  }
  .hub-revenue-big {
    font-size: 1.5rem;
  }
  .hub-revenue-hero {
    padding: 1rem;
  }
}
