/* Dashboard — uses same CSS vars as theme.css */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Outfit:wght@300;400;500;600&display=swap');

/* ── Layout ── */
.dash-wrapper {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.dash-main {
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Dashboard Header ── */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.dash-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}

.dash-subtitle {
  font-size: 0.9rem;
  color: var(--fg-muted);
  font-weight: 300;
  margin-top: 0.25rem;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-card-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.stat-card-value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}

.stat-card-value--accent { color: var(--accent); }
.stat-card-value--warn  { color: var(--rose); }
.stat-card-value--ok     { color: var(--sage); }

.stat-card-sub {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 300;
}

/* ── Grid: Revenue Chart + Alerts ── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: 16px;
  padding: 1.75rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--fg);
}

/* ── Revenue Chart ── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 0.5rem;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.chart-bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
  min-height: 4px;
  transition: background 0.2s;
}

.chart-bar:hover { background: var(--rose); }

.chart-label {
  font-size: 0.65rem;
  color: var(--fg-muted);
  font-weight: 400;
}

.chart-amount {
  font-size: 0.7rem;
  color: var(--fg);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Alert List ── */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #FFF5F0;
  border: 1px solid #F0C8B8;
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.alert-body { flex: 1; }

.alert-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.3;
}

.alert-meta {
  font-size: 0.75rem;
  color: var(--rose);
  font-weight: 400;
  margin-top: 0.15rem;
}

.no-alerts {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--sage);
  font-size: 0.9rem;
}

/* ── Tables ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--fg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--cream);
}

.data-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--cream);
  color: var(--fg);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-alt); }

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.stock-badge--ok     { background: #EAFAF0; color: var(--sage); }
.stock-badge--warn   { background: #FFF5E0; color: #B07000; }
.stock-badge--crit   { background: #FFF0EC; color: var(--rose); }

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
}

.status-badge--unfulfilled { background: #FFF0EC; color: var(--rose); }
.status-badge--fulfilled   { background: #EAFAF0; color: var(--sage); }
.status-badge--partial     { background: #FFF5E0; color: #B07000; }
.status-badge--paid         { background: #E8F4EA; color: #3A7A3A; }
.status-badge--pending     { background: #F0F0F0; color: var(--fg-muted); }

/* ── Setup / Connect Panel ── */
.setup-panel {
  max-width: 560px;
  margin: 4rem auto;
  background: var(--white);
  border: 1px solid var(--cream);
  border-radius: 24px;
  padding: 3rem;
}

.setup-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.75rem;
}

.setup-desc {
  font-size: 0.95rem;
  color: var(--fg-muted);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--cream);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}

.btn-primary:hover { background: var(--rose); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.error-msg {
  padding: 0.85rem 1rem;
  background: #FFF0EC;
  border: 1px solid #F0C0B0;
  border-radius: 10px;
  color: var(--rose);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .dash-main { padding: 1.5rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .dash-title { font-size: 1.8rem; }
  .setup-panel { padding: 2rem; margin: 2rem auto; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}