/* Dashboard: hero + stats, upload panel, certificate list */
.hero { background: radial-gradient(circle at 85% 0%, #2a3d94 0, transparent 45%), linear-gradient(120deg, var(--navy-deep), var(--navy)); color: #fff; padding: 44px 0 100px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 22px 22px; }
.hero .wrap { position: relative; }
.hero h1 { font-size: 34px; margin: 14px 0 8px; letter-spacing: -.3px; }
.hero p { color: #c7d2fe; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 16px; margin-top: 28px; }
.stat { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 16px 18px; backdrop-filter: blur(6px); }
.stat b { display: block; font: 800 28px Montserrat, sans-serif; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 12px; color: #c7d2fe; text-transform: uppercase; letter-spacing: 1px; }

/* Upload */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 28px; }
.upload { margin-top: -64px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; align-items: stretch; position: relative; }
.panel h2 { font-size: 20px; color: var(--navy); margin: 0 0 4px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.drop { border: 2px dashed #c7cde0; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; cursor: pointer; transition: .2s; min-height: 220px; margin: 0; }
.drop:hover, .drop.over { border-color: var(--amber); background: #fffbf3; }
.drop.over { transform: scale(1.01); }
.drop .ic { width: 60px; height: 60px; border-radius: 18px; background: linear-gradient(135deg, var(--navy), var(--navy-deep)); display: grid; place-items: center; margin-bottom: 14px; transition: .2s; }
.drop:hover .ic { transform: translateY(-3px); }
.drop b { color: var(--navy); font-size: 16px; word-break: break-all; }
.drop span { color: var(--muted); font-size: 13px; margin-top: 4px; }
.drop.has-file { border-style: solid; border-color: var(--navy); background: #f5f7ff; }
.drop .pill { margin-top: 14px; font-size: 12px; font-weight: 600; color: var(--navy); background: var(--bg); border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; }
.progress { height: 8px; background: #eef0f6; border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-dark)); border-radius: 99px; transition: width .15s; }

/* List */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin: 52px 0 22px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; color: var(--navy); margin: 0; }
.section-head h2 small { font: 600 14px Inter, sans-serif; color: var(--muted); margin-left: 6px; }
.section-head h2::after { content: ""; display: block; width: 48px; height: 4px; background: var(--amber); border-radius: 4px; margin-top: 8px; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; }
.search { position: relative; width: 280px; max-width: 100%; }
.search input { padding-left: 40px; border-radius: 999px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); }
.tools select { width: auto; border-radius: 999px; padding-right: 34px; cursor: pointer; appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231B2A6B' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; margin-bottom: 64px; }
.cert { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: .25s; display: flex; flex-direction: column; animation: rise .4s ease both; }
.cert:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.cert .qr { background: linear-gradient(180deg, var(--bg), #fff); padding: 46px 22px 22px; /* top room for the tags */ display: grid; place-items: center; border-bottom: 1px solid var(--border); position: relative; cursor: zoom-in; }
.cert .qr img { width: 160px; height: 160px; background: #fff; padding: 8px; border-radius: 12px; box-shadow: 0 4px 14px -6px rgba(0,0,0,.15); transition: .25s; }
.cert .qr:hover img { transform: scale(1.04); }
/* z-index: the QR image gets its own layer while scaled on hover and would cover these otherwise */
.cert .qr .zoom { z-index: 1; position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 8px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; color: var(--navy); opacity: 0; transition: .2s; }
.cert .qr:hover .zoom { opacity: 1; }
.cert .tag { z-index: 1; position: absolute; top: 12px; left: 12px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .5px; }
.cert .tag.new { background: var(--amber); color: var(--navy-deep); }
.cert .tag.stamped { left: auto; right: 12px; background: var(--success); }
.cert .qr:hover .tag.stamped { opacity: 0; }
.cert .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.cert h3 { font-size: 16px; margin: 0 0 6px; color: var(--navy); word-break: break-word; line-height: 1.35; }
.cert .meta { font-size: 13px; color: var(--muted); margin-bottom: 16px; display: flex; flex-direction: column; gap: 3px; }
.cert .meta span { display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cert .meta svg { flex-shrink: 0; }
.cert .actions { display: flex; gap: 8px; margin-top: auto; }
.cert .actions .btn-amber { flex: 1; }
.cert .actions + .actions { margin-top: 8px; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; background: #fff; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--muted); }
.empty .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--amber-soft); display: inline-grid; place-items: center; }
.empty b { display: block; font: 700 18px Montserrat, sans-serif; color: var(--navy); margin: 14px 0 4px; }

/* Loading skeleton */
.skel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.skel .a { height: 229px; } /* same height as .cert .qr */
.skel .b { margin: 16px 18px 8px; height: 14px; width: 70%; border-radius: 6px; }
.skel .c { margin: 0 18px 18px; height: 12px; width: 45%; border-radius: 6px; }
.shimmer { background: linear-gradient(90deg, #f1f3f8 25%, #e6e9f2 50%, #f1f3f8 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 860px) {
  .upload { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat { padding: 12px; }
  .stat b { font-size: 20px; }
  .search { width: 100%; }
  .tools { width: 100%; }
  .tools select { flex: 1; }
}
