﻿/* =============================================
   DASHBOARD STYLES
   ============================================= */

body { overflow: hidden; height: 100vh; }

/* LAYOUT */
.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.dash-sidebar {
  background: rgba(6, 6, 18, 0.98);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.dash-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.dash-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.dash-nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.dash-nav-active {
  background: rgba(124, 58, 237, 0.12) !important;
  color: var(--accent-violet-light) !important;
  font-weight: 600;
}

.dash-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 14px;
}

/* PLAN CARD */
.dash-plan-card {
  margin: 16px 10px;
  background: var(--bg-glass);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-plan-badge {
  display: inline-block;
  background: var(--gradient-brand);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  width: fit-content;
  letter-spacing: 0.05em;
}

.dash-plan-usage-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.dash-plan-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.dash-plan-bar-fill {
  height: 100%;
  background: var(--gradient-brand);
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* MAIN */
.dash-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

/* TOPBAR */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 15, 0.6);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.dash-page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.dash-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dash-page-subtitle strong {
  color: var(--text-secondary);
}

.dash-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.4);
}

/* STATS */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px 32px 0;
  flex-shrink: 0;
}

.dash-stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.dash-stat-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.dash-stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-stat-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dash-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.dash-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-stat-trend {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.trend-up {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
}

/* CONTENT GRID */
.dash-content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  padding: 20px 32px 24px;
  overflow-y: auto;
  flex: 1;
}

/* CARDS */
.dash-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

/* FILTER BUTTONS */
.dash-filter {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
}

.dash-filter-btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.dash-filter-btn:hover { color: var(--text-primary); }

.dash-filter-active {
  background: rgba(124, 58, 237, 0.2) !important;
  color: var(--accent-violet-light) !important;
}

/* IMAGES GRID */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.image-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--transition);
  group: true;
}

.image-thumb:hover {
  transform: scale(1.04);
  border-color: var(--border-accent);
  z-index: 2;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.image-thumb-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background-image:
    linear-gradient(45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a2e 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a2e 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a2e 75%);
  background-size: 12px 12px;
  background-color: #0d0d1a;
}

.image-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.8), transparent 60%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 8px;
}

.image-thumb:hover .image-thumb-overlay {
  opacity: 1;
}

.image-thumb-name {
  font-size: 10px;
  color: white;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.image-thumb-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  background: rgba(0,0,0,0.7);
  color: var(--text-muted);
  backdrop-filter: blur(4px);
}

.dash-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* SIDE PANEL */
.dash-side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* USAGE CHART */
.usage-chart {
  display: flex;
  align-items: center;
  gap: 20px;
}

.usage-donut {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.donut-svg {
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.donut-pct {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.donut-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.usage-period {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.usage-breakdown {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.usage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.usage-item span {
  flex: 1;
  color: var(--text-muted);
}

.usage-item strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.usage-item-remaining strong {
  color: var(--accent-emerald);
}

/* QUICK ACTIONS */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
  color: var(--text-primary);
}

.quick-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.quick-action-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-violet-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-action div strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-action div span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.quick-action > svg {
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* BILLING CARD */
.dash-card-billing {
  background: rgba(124, 58, 237, 0.06);
  border-color: rgba(124, 58, 237, 0.2);
}

.billing-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.billing-plan-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.billing-plan-price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.billing-plan-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 5px 12px;
  border-radius: var(--radius-full);
}

.billing-next {
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

.billing-next strong {
  color: var(--text-secondary);
}

.billing-actions {
  display: flex;
  gap: 8px;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-content-grid { grid-template-columns: 1fr; }
}


