/* Organiser certificates page (certificates.html) — builds on dashboard-v2.css */
.crt-card{padding:22px;margin-bottom:18px}
.crt-picker{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between}
.crt-picker>div{flex:1 1 320px;max-width:640px}
.crt-label{display:block;margin:12px 0 6px;color:var(--navy);font-size:.74rem;font-weight:850}
.crt-picker .crt-label{margin-top:0}
.crt-muted{color:var(--muted);font-weight:600}
.crt-hint{margin:8px 0 0;color:var(--muted);font-size:.72rem;line-height:1.6}
.crt-pill{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;font-size:.7rem;font-weight:900;background:#f1f5f9;color:#475569}
.crt-pill.good{background:#dcfce7;color:#075a37}.crt-pill.warn{background:#fff7ed;color:#9a3412}
.crt-empty{text-align:center;padding:40px 22px}.crt-empty i{font-size:2rem;color:var(--green)}.crt-empty h2{margin:12px 0 4px;color:var(--navy)}.crt-empty p{color:var(--muted)}

.crt-head{display:flex;gap:14px;align-items:flex-start;margin-bottom:14px}
.crt-head h2{margin:0;color:var(--navy);font-size:1.08rem;letter-spacing:-.02em}
.crt-head p{margin:4px 0 0;color:var(--muted);font-size:.74rem}
.crt-head-wrap{flex-wrap:wrap;justify-content:space-between;align-items:flex-end}
.crt-head-left{display:flex;gap:14px;align-items:flex-start;flex:1 1 360px}
.crt-step{flex:0 0 34px;width:34px;height:34px;display:grid;place-items:center;border-radius:11px;color:#fff;background:linear-gradient(135deg,var(--green),var(--green2));font-weight:900}

.crt-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.crt-row .control{flex:1 1 220px;width:auto}
.crt-gap{gap:10px;margin-top:12px}
.crt-upload{padding:14px 16px;margin-bottom:16px;border:1px dashed #b6c7bf;border-radius:14px;background:#f8fbf9}
.crt-upload .crt-label{margin-top:0}
.crt-file{padding:8px}

.crt-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,1fr);gap:22px;align-items:start}
.crt-stage{position:relative;width:100%;border-radius:10px;overflow:hidden;box-shadow:0 1px 0 #e3e9e5,0 10px 28px rgba(7,26,51,.14);user-select:none;touch-action:none;background:#eef2f0}
.crt-stage img{display:block;width:100%;height:auto;pointer-events:none;min-height:120px}
.crt-box{position:absolute;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;padding:2px 0;border:1.5px dashed rgba(73,36,175,.75);border-radius:4px;cursor:grab;outline:none}
.crt-box:hover,.crt-box:focus-visible{background:rgba(73,36,175,.07);border-style:solid}
.crt-box.dragging{cursor:grabbing;background:rgba(73,36,175,.1)}
.crt-box[hidden]{display:none}
.crt-box span:first-child{display:inline-block;white-space:nowrap;line-height:1.15;pointer-events:none}
.crt-handle{position:absolute;right:-7px;top:50%;width:12px;height:26px;margin-top:-13px;border-radius:4px;background:#4924af;cursor:ew-resize}
.crt-number{transform:translate(-50%,-50%);padding:1px 6px;font-family:Georgia,serif;white-space:nowrap}
.crt-controls hr{margin:16px 0;border:0;border-top:1px solid var(--line)}
.crt-controls .control{width:100%}
.crt-range{width:100%;accent-color:var(--green)}
.crt-two{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:end}
.crt-color{width:56px;height:43px;padding:3px;border:1px solid var(--line);border-radius:12px;background:#fff}
.crt-check{display:flex;gap:8px;align-items:center;margin:10px 0 4px;font-size:.76rem;font-weight:700;color:var(--text)}
.crt-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.crt-chip{display:inline-flex;gap:6px;align-items:center;padding:7px 11px;border:1px solid var(--line);border-radius:999px;font-size:.7rem;font-weight:800;background:#fff}

.crt-tests{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:16px}
.crt-test{padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}
.crt-test .crt-label{margin-top:0}
.crt-result{margin:8px 0 0;color:var(--muted);font-size:.7rem}
.crt-result.ok{color:#075a37;font-weight:800}
.btn-whatsapp{color:#fff;background:#1fa855;box-shadow:0 10px 24px rgba(31,168,85,.2)}
.btn:disabled{opacity:.5;cursor:not-allowed;transform:none!important}
.crt-busy{position:relative;pointer-events:none}
.crt-busy:after{content:"";width:14px;height:14px;margin-left:4px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:crt-spin .7s linear infinite}
@keyframes crt-spin{to{transform:rotate(360deg)}}

.crt-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
.crt-kpi{padding:14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}
.crt-kpi strong{display:block;color:var(--navy);font-size:1.5rem;line-height:1.1}
.crt-kpi span{display:block;margin-top:4px;color:var(--muted);font-size:.64rem;font-weight:800}
.crt-kpi.good{border-color:#bbf7d0;background:#f0fdf4}.crt-kpi.bad{border-color:#fecaca;background:#fef2f2}
.crt-share{margin-top:16px;padding:14px 16px;border:1px solid #bbf7d0;border-radius:14px;background:#f0fdf4}
.crt-share .crt-label{margin-top:0}
.crt-share textarea{width:100%;font-size:.74rem;background:#fff}

.crt-table-wrap{overflow-x:auto}
.crt-table{width:100%;border-collapse:collapse;font-size:.76rem}
.crt-table th{padding:10px 8px;border-bottom:1px solid var(--line);color:#64748b;font-size:.62rem;text-align:left;text-transform:uppercase;letter-spacing:.06em}
.crt-table td{padding:10px 8px;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.crt-right{text-align:right}
.crt-actions{white-space:nowrap}
.crt-actions .btn{margin:2px 0}
.crt-sm{min-height:34px;padding:6px 10px;border-radius:10px;font-size:.68rem}
.crt-rename{display:flex;gap:6px;min-width:240px}
.crt-rename .control{min-height:36px;padding:6px 10px}
.crt-table small{display:block}
.crt-badge{display:inline-block;padding:4px 8px;border-radius:999px;background:#e2e8f0;color:#475569;font-size:.6rem;font-weight:900}
.crt-badge.good{background:#dcfce7;color:#075a37}.crt-badge.bad{background:#fee2e2;color:#991b1b}.crt-badge.info{background:#dbeafe;color:#1e40af}
.crt-empty-row{padding:26px 8px!important;color:var(--muted);text-align:center}
.crt-pages{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}
.crt-page{min-width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;font-weight:800;cursor:pointer}
.crt-page.active{color:#fff;border-color:var(--green);background:var(--green)}

.crt-modal{position:relative;width:min(1100px,100%);max-height:94vh;overflow:auto;padding:18px;border-radius:20px;background:#fff}
.crt-modal-close{color:var(--navy);border-color:var(--line);background:#fff;top:12px;right:12px}
.crt-modal-caption{margin:0 50px 12px 0;color:var(--navy);font-weight:800;font-size:.82rem}
.crt-modal-body img{display:block;width:100%;height:auto;border-radius:8px;box-shadow:0 8px 24px rgba(7,26,51,.12)}

@media(max-width:1100px){.crt-layout{grid-template-columns:1fr}.crt-kpis{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){
  .crt-card{padding:16px}
  .crt-tests{grid-template-columns:1fr}
  .crt-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .crt-table thead{display:none}
  .crt-table,.crt-table tbody,.crt-table tr,.crt-table td{display:block;width:100%}
  .crt-table tr{margin-bottom:12px;padding:8px 10px;border:1px solid var(--line);border-radius:14px}
  .crt-table td{border:0;padding:6px 0}
  .crt-right{text-align:left}
  .crt-actions{white-space:normal}
  .crt-rename{min-width:0}
}
