/* dashboard.css — Customer dashboard styles */

.dash-section {
  padding: 100px 0 80px;
  min-height: 80vh;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.dash-header h1 {
  font-size: 2rem;
  margin: 0;
}

/* Tabs */
.dash-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  overflow-x: auto;
}
.dash-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.dash-tab:hover {
  color: var(--text);
}
.dash-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

/* Panels */
.dash-panel {
  animation: fadeIn 0.3s ease;
}
.dash-panel.hidden {
  display: none;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Overview cards */
.dash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-card-value {
  font-size: 1.4rem;
  font-weight: 700;
}

/* Billing info */
.dash-billing-info {
  max-width: 600px;
}
.dash-billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.dash-billing-row span {
  color: var(--text-muted);
}

/* Invoice table */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
}
.invoice-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.invoice-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.invoice-table tr:hover td {
  background: var(--bg-alt);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 980px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.status-badge.active, .status-badge.paid {
  background: rgba(52, 211, 153, 0.15);
  color: var(--green);
}
.status-badge.trialing {
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue);
}
.status-badge.past_due, .status-badge.open {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.status-badge.cancelled {
  background: rgba(134, 134, 139, 0.15);
  color: var(--text-muted);
}

/* Billing toggle buttons (reused on cart page too) */
.btn-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 980px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.btn-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.btn-toggle.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Verified badge */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
}
.verified-badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.verify-link {
  color: var(--blue);
  font-size: 0.8rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}
.verify-link:hover { opacity: 0.8; }
.verify-link:disabled {
  opacity: 0.5;
  cursor: default;
  text-decoration: none;
}

/* Verify banner (overview tab) */
.verify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  background: rgba(37, 99, 235, 0.08);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease;
}
.verify-banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.verify-banner-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.verify-banner .btn-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.verify-banner .btn-dismiss:hover { color: var(--text); }

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}
.toast {
  background: var(--green);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s forwards;
  pointer-events: auto;
}
.toast.error {
  background: #ef4444;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-12px); }
}

/* Invoice header with download button */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.invoice-header h2 { margin: 0; }
.btn-download-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-download-all:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.btn-download-all:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-download-all .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Email field row with badge */
.email-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.email-field-row input {
  flex: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .dash-section { padding: 80px 0 60px; }
  .dash-header h1 { font-size: 1.5rem; }
  .dash-tab { padding: 10px 14px; font-size: 0.82rem; }
  .dash-cards { grid-template-columns: 1fr; }
  .dash-billing-row { font-size: 0.85rem; }
  .invoice-table { font-size: 0.82rem; }
  .invoice-table th, .invoice-table td { padding: 10px 8px; }
  .verify-banner { flex-direction: column; align-items: flex-start; }
  .invoice-header { flex-direction: column; gap: 12px; align-items: flex-start; }
}

/* ---------------------------------------------------------------------------
   Your Workspace card (dashboard overview)
--------------------------------------------------------------------------- */
.ws-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 24px;
  margin-bottom: 24px;
}
.ws-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.ws-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ws-url {
  color: var(--blue);
  font-size: 0.9rem;
  text-decoration: none;
}
.ws-url:hover {
  text-decoration: underline;
}
.ws-banner {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.ws-banner.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.35);
}
.ws-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.ws-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.ws-meter-bar {
  height: 8px;
  border-radius: 980px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  overflow: hidden;
}
.ws-meter-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 980px;
  transition: width 0.3s;
}
.ws-meter-fill.warn {
  background: #ef4444;
}
/* Tenant statuses not already covered above */
.status-badge.suspended {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}
.status-badge.provisioning {
  background: rgba(37, 99, 235, 0.15);
  color: var(--blue);
}
.status-badge.churned, .status-badge.failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
