﻿/* ── Dashboard Key + Credits Row ──────────────────────────────────────────── */
.dashboard-key-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dashboard-key-card .key-panel,
.dashboard-credits-card .credits-panel {
  padding: 1.25rem 1.5rem;
}

.key-name-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.key-name { font-weight: 700; font-size: 14px; }

.key-display-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.key-value {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-mid);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.key-hint {
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.5;
}
.key-hint code { font-family: var(--font-mono); font-size: 11px; }
.key-empty {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--color-text-mid);
}

.credits-big-number {
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px;
}
.credits-remaining {
  font-family: var(--font-heading);
  font-size: 40px; font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.04em;
}
.credits-total { font-size: 16px; color: var(--color-text-light); }
.credits-hint {
  font-size: 12px; color: var(--color-text-light);
  margin-top: 8px;
}

/* ── Inline OCR Panel ─────────────────────────────────────────────────────── */
.ocr-panel { margin-bottom: 1.5rem; }

.ocr-panel-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

.ocr-panel-left  { display: flex; flex-direction: column; gap: 1rem; }
.ocr-panel-right { display: flex; flex-direction: column; gap: 0.75rem; }

.ocr-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--color-text-mid);
  font-size: 14px;
}
.ocr-placeholder .placeholder-icon { font-size: 40px; color: var(--color-border-mid); }

@media (max-width: 768px) {
  .dashboard-key-row { grid-template-columns: 1fr; }
  .ocr-panel-body    { grid-template-columns: 1fr; }
}

/* ── Dashboard: API Key Banner ────────────────────────────────────────────── */
.db-key-banner {
  border: 2px solid var(--color-warning);
  border-radius: var(--radius-lg);
  background: #FFFBEB;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.db-key-banner-left {
  display: flex; align-items: center; gap: 12px; margin-bottom: 1rem;
}
.db-key-banner-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: #FEF3C7;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--color-warning); font-size: 16px;
}
.db-key-banner-title  { font-weight: 700; font-size: 14px; color: #92400E; margin-bottom: 2px; }
.db-key-banner-sub    { font-size: 12px; color: #B45309; }
.db-key-banner-link   { color: #92400E; font-weight: 600; text-decoration: underline; }
.db-key-banner-code-row {
  display: flex; align-items: center; gap: 10px;
  background: #0d1b2e; border-radius: var(--radius-md);
  padding: 0.875rem 1.125rem;
}
.db-key-banner-code {
  font-family: var(--font-mono); font-size: 13px;
  color: #93C5FD; flex: 1;
  word-break: break-all; letter-spacing: 0.04em;
}

/* ── Dashboard: Middle Row ────────────────────────────────────────────────── */
.db-mid-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* Chart card */
.db-chart-card { overflow: hidden; }
.db-chart-card .full-chart-wrap { padding: 1rem 1.5rem 0.5rem; }
.db-chart-period { font-size: 12px; color: var(--color-text-light); margin-top: 1px; }
.db-chart-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 2.5rem; color: var(--color-text-light); font-size: 13px; text-align: center;
}
.db-chart-empty i { font-size: 28px; opacity: 0.4; }
.db-chart-stats-row {
  display: flex; align-items: center;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--color-border);
  gap: 0;
}
.db-cs {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 2px;
}
.db-cs-val {
  font-family: var(--font-heading);
  font-size: 20px; font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}
.db-cs-lbl { font-size: 11px; color: var(--color-text-light); font-weight: 500; }
.db-cs-divider {
  width: 1px; height: 32px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Active API Key card */
.db-apikey-card { overflow: hidden; }
.db-apikey-body { padding: 1.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.875rem; }

.db-apikey-display {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  overflow: hidden;
}
.db-apikey-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--color-text-mid);
  word-break: break-all;
  letter-spacing: 0.02em;
  display: block;
}
.db-apikey-code--revealed { color: var(--color-primary); }

.db-apikey-actions {
  display: flex; gap: 8px;
}
.db-apikey-reveal { flex: 1; }
.db-apikey-copy   { flex: 1; }

.db-apikey-meta {
  display: flex; flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.db-km-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.625rem 0.875rem;
  font-size: 13px;
}
.db-km-row + .db-km-row { border-top: 1px solid var(--color-border); }
.db-km-label { color: var(--color-text-light); font-weight: 500; }
.db-km-val   { color: var(--color-text); font-weight: 600; font-size: 13px; }

.db-apikey-manage {
  text-align: center; font-size: 13px; font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.625rem;
}
.db-apikey-manage:hover { background: var(--color-surface-mid); text-decoration: none; }

/* Responsive: mid-row collapses on tablet */
@media (max-width: 1024px) {
  .db-mid-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .db-key-banner-code-row { flex-wrap: wrap; }
  .db-key-banner-code     { font-size: 11px; }
  .db-apikey-actions      { flex-direction: column; }
}
