/**
 * dashboard.css — Styles for the dashboard page.
 * Requires: vars.css
 */

body {
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.page-body { max-width: 1100px; margin: 0 auto; padding: 24px 20px 64px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: #6b7280; margin-bottom: 32px; }

/* ── Section header ──────────────────────────────────────────────────────── */
.section-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; margin-top: 36px;
}
.section-head:first-of-type { margin-top: 0; }

.section-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.section-icon.blue  { background: var(--blue-bg);  color: var(--blue); }
.section-icon.green { background: var(--green-bg); color: var(--green); }
.section-icon.amber { background: var(--amber-bg); color: var(--amber); }

.section-head h6 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.section-head .section-line { flex: 1; height: 1px; background: var(--border); margin-left: 4px; }

/* ── Cards grid ──────────────────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ── Function card ───────────────────────────────────────────────────────── */
.fn-card {
  background: #fff;
  border: 1.5px solid #e8edf5;
  border-radius: 16px;
  padding: 22px 20px 18px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  cursor: pointer;
}
.fn-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(26,86,219,.13);
  border-color: #93c5fd;
}
.fn-card .card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.fn-card .card-icon.blue  { background: var(--blue-bg);  color: var(--blue); }
.fn-card .card-icon.green { background: var(--green-bg); color: var(--green); }
.fn-card .card-icon.amber { background: var(--amber-bg); color: var(--amber); }
.fn-card .card-icon.purple{ background: #ede9fe; color: #7c3aed; }
.fn-card .card-icon.rose  { background: #ffe4e6; color: #e11d48; }
.fn-card .card-icon.teal  { background: #ccfbf1; color: #0f766e; }
.fn-card .card-icon.gray  { background: var(--border-lt); color: #475569; }
.fn-card .card-icon.primary   { background: #dbeafe; color: #2563eb; }
.fn-card .card-icon.secondary { background: #e9ecef; color: #5c636a; }
.fn-card .card-icon.danger    { background: #f8d7da; color: #dc3545; }
.fn-card .card-icon.warning  { background: #fff3cd; color: #ffc107; }
.fn-card .card-icon.success  { background: #d1e7dd; color: #198754; }
.fn-card .card-icon.info     { background: #cff4fc; color: #0dcaf0; }

.fn-card .card-label { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.fn-card .card-desc  { font-size: 12px; color: #6b7280; margin: 0; line-height: 1.5; }
.fn-card .card-arrow {
  margin-top: auto; font-size: 13px; color: #93c5fd;
  display: flex; align-items: center; gap: 4px; font-weight: 600;
}

/* ── Mobile redesign ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  
  .fn-card {
    border: none;
    padding: 16px 12px;
    align-items: center;
    text-align: center;
  }
  
  .fn-card .card-desc,
  .fn-card .card-arrow {
    display: none;
  }
  
  .fn-card .card-label {
    font-size: 12px;
    margin-top: 8px;
  }
  
  .fn-card .card-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .fn-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
  }
}

/* ── Empty card ──────────────────────────────────────────────────────────── */
.empty-card {
  background: #fff; border: 1.5px dashed var(--border);
  border-radius: 16px; padding: 32px 20px;
  text-align: center; color: var(--text-muted); font-size: 13px;
}
.empty-card .bi { font-size: 28px; margin-bottom: 8px; display: block; }

/* ── External link badge ─────────────────────────────────────────────────── */
.ext-badge {
  font-size: 10px; background: var(--border-lt); color: #64748b;
  border-radius: 4px; padding: 1px 5px; vertical-align: middle;
  font-weight: 500; letter-spacing: .3px;
}

/* ── Collapsible section ─────────────────────────────────────────────────── */
.section-head.collapsible { cursor: pointer; user-select: none; }
.section-head.collapsible:hover h6 { color: var(--blue); }
.section-chevron { font-size: 14px; color: var(--text-muted); transition: transform .25s; flex-shrink: 0; }
.section-chevron.open { transform: rotate(180deg); }
.collapsible-body { overflow: hidden; transition: max-height .3s ease, opacity .25s ease; }
.collapsible-body.collapsed { max-height: 0 !important; opacity: 0; pointer-events: none; }
