/* ═══════════════════════════════════════
   CARDS — Premium Card Components
   ═══════════════════════════════════════ */

/* ─── Base Card ─────────────────────── */
.workspace-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.workspace-card:hover {
  border-color: #DDE4F0;
}

/* ─── Metric / Stat Card ────────────── */
.metric-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: default;
}

.metric-card:hover {
  border-color: #D0D8E8;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Decorative circle */
.metric-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--metric-soft);
  opacity: 0.55;
  transition: transform var(--duration-normal) var(--ease-out);
}

.metric-card:hover::after {
  transform: scale(1.1);
}

/* ─── Metric Icon ───────────────────── */
.metric-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--metric-soft);
  color: var(--metric);
  position: relative;
  z-index: 1;
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

/* ─── Metric Content ────────────────── */
.metric-main {
  min-width: 0;
  flex: 1;
  position: relative;
  z-index: 1;
}

.metric-main span,
.metric-main strong,
.metric-main small {
  display: block;
}

.metric-main span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.metric-main strong {
  font-size: 28px;
  line-height: 1.1;
  margin: 4px 0 6px;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--ink);
}

.metric-main small {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.metric-main small b {
  color: var(--success);
  font-weight: 700;
}

/* ─── Metric Link Arrow ─────────────── */
.metric-card > a {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.metric-card > a:hover {
  background: var(--bg-alt);
  color: var(--brand);
}

/* ─── Metric Color Variants ─────────── */
.metric-blue {
  --metric: #2563EB;
  --metric-soft: #EFF3FF;
}

.metric-violet {
  --metric: #7C3AED;
  --metric-soft: #F5F3FF;
}

.metric-orange {
  --metric: #EA580C;
  --metric-soft: #FFF7ED;
}

.metric-green {
  --metric: #059669;
  --metric-soft: #ECFDF5;
}

.metric-rose {
  --metric: #E11D48;
  --metric-soft: #FFF1F2;
}

.metric-amber {
  --metric: #D97706;
  --metric-soft: #FFFBEB;
}

/* Dark theme adjustments */
html[data-theme="dark"] .metric-blue {
  --metric-soft: #1E3A6E;
}

html[data-theme="dark"] .metric-violet {
  --metric-soft: #2E1952;
}

html[data-theme="dark"] .metric-orange {
  --metric-soft: #3B200F;
}

html[data-theme="dark"] .metric-green {
  --metric-soft: #052E16;
}

html[data-theme="dark"] .metric-rose {
  --metric-soft: #4C0519;
}

html[data-theme="dark"] .metric-amber {
  --metric-soft: #451A03;
}

/* ─── Stats Grid ────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

/* ─── Action Tile Card ──────────────── */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.action-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 80px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.action-tile:hover {
  transform: translateY(-2px);
  border-color: #C7D4F0;
  box-shadow: var(--shadow-md);
  background: var(--surface);
}

.action-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--brand);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  transition: all var(--duration-fast) var(--ease-out);
}

.action-tile:hover .action-icon {
  border-color: #BFCFF0;
  box-shadow: var(--shadow-sm);
}

.action-icon svg {
  width: 22px;
  height: 22px;
}

.action-tile div {
  min-width: 0;
  flex: 1;
}

.action-tile strong,
.action-tile small {
  display: block;
}

.action-tile strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.action-tile small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.action-tile > b {
  font-size: 18px;
  color: #B0BCCC;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
}

.action-tile:hover > b {
  transform: translateX(3px);
  color: var(--brand);
}

/* Primary action tile */
.action-tile.action-primary {
  background: linear-gradient(135deg, #F0F4FF, #F5F3FF);
  border-color: #D8E2FC;
}

.action-tile.action-primary:hover {
  border-color: #BBCDF8;
}

.action-primary .action-icon {
  background: var(--brand);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ─── Empty State Card ──────────────── */
.empty-state {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
}

.empty-state > span {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.empty-state svg {
  width: 26px;
  height: 26px;
}

.empty-state strong {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.empty-state p {
  max-width: 420px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

/* ─── Progress Track ────────────────── */
.progress-track {
  height: 6px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563EB, #6366F1);
  border-radius: inherit;
  transition: width var(--duration-slow) var(--ease-out);
}

.progress-percent {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ─── Checklist ─────────────────────── */
.checklist {
  display: grid;
  gap: 4px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast) var(--ease-out);
}

.check-row:hover {
  background: var(--bg-alt);
}

.check-row > span {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.check-row.complete > span {
  background: var(--success-soft);
  color: var(--success);
  border-color: #A7F3D0;
}

.check-row > div {
  flex: 1;
  min-width: 0;
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.check-row small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.check-row > b {
  font-size: 16px;
  color: #B0BCCC;
  flex-shrink: 0;
}

.check-row.complete strong {
  color: var(--muted);
}

/* ─── Tip Card ──────────────────────── */
.tip-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #1E3A6E, #1E40AF);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
}

.tip-card::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.tip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #93C5FD;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}

.tip-illustration {
  font-size: 36px;
  margin: 18px 0 10px;
  position: relative;
  z-index: 1;
}

.tip-card h3 {
  font-size: 18px;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
  font-weight: 700;
}

.tip-card p {
  color: #BFDBFE;
  font-size: 11px;
  line-height: 1.6;
  margin: 0 0 16px;
  position: relative;
  z-index: 1;
}

.tip-card a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  position: relative;
  z-index: 1;
  transition: gap var(--duration-fast) var(--ease-out);
}

.tip-card a:hover {
  gap: 8px;
}

.tip-card a span {
  font-size: 13px;
}

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

@media (max-width: 700px) {
  .stats-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .workspace-card {
    padding: 18px;
  }

  .action-tile {
    min-height: auto;
  }

  .metric-main small {
    white-space: normal;
  }
}