/* Athlete Certificates – admin styles */
.acm-wrap .acm-card { background: #fff; border: 1px solid #dcdcde; border-radius: 8px; padding: 16px 20px; margin: 16px 0; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.acm-wrap .acm-card h2, .acm-wrap .acm-card h3 { margin-top: 4px; }
.acm-form .form-table th { width: 200px; }
.acm-inline { display: inline; }
.acm-actions .button { margin: 2px 0; }
.acm-sub { color: #888; font-size: 11px; }
.acm-warn { color: #b32d2e; }
.acm-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: #f0f0f1; color: #50575e; font-size: 12px; }
.acm-badge.ok { background: #e6f4ea; color: #1e7b34; }
.acm-badge.bad { background: #fcebea; color: #b32d2e; }

/* Dashboard */
.acm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.acm-stat { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #dcdcde; border-radius: 8px; padding: 14px 16px; text-decoration: none; color: #1d2327; }
.acm-stat:hover { border-color: #2271b1; }
.acm-stat .dashicons { color: #2271b1; font-size: 22px; width: 22px; height: 22px; }
.acm-stat strong { font-size: 26px; line-height: 1.2; }
.acm-stat span:last-child { color: #646970; }
.acm-steps li { margin-bottom: 8px; font-size: 14px; }

/* Lists */
.acm-filters { margin: 12px 0; }
.acm-bulkbar { margin: 8px 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acm-bulk-extra { display: none; }
.acm-count { color: #646970; margin-left: auto; }
.acm-athletes td, .acm-athletes th { vertical-align: middle; }
.acm-cols { display: flex; gap: 20px; align-items: flex-start; }
.acm-col-narrow { flex: 0 0 340px; }
.acm-col-wide { flex: 1; margin-top: 16px; }

/* Templates grid */
.acm-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.acm-tpl-card { background: #fff; border: 1px solid #dcdcde; border-radius: 8px; overflow: hidden; }
.acm-tpl-card img { display: block; width: 100%; height: auto; background: #f6f7f7; min-height: 120px; }
.acm-tpl-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }

/* Editor */
.acm-editor { display: flex; gap: 20px; align-items: flex-start; }
.acm-editor-panel { flex: 0 0 420px; max-width: 420px; }
.acm-editor-preview { flex: 1; min-width: 0; align-self: stretch; }
.acm-sticky { position: sticky; top: 46px; margin-top: 16px; }
.acm-preview-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.acm-preview-bar .button-primary { margin-left: auto; }
.acm-preview-box { position: relative; background: #e9eaec; border-radius: 8px; padding: 0; line-height: 0; box-shadow: 0 4px 18px rgba(0,0,0,.12); }
#acm-preview { width: 100%; height: auto; cursor: crosshair; border-radius: 6px; outline: none; min-height: 200px; }
#acm-preview:focus { box-shadow: 0 0 0 2px #2271b1; }
#acm-marker { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid #d63638; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2px rgba(255,255,255,.8); display: none; }
.acm-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.acm-grid2 label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #50575e; }
.acm-grid2 .acm-full { grid-column: 1 / -1; }
.acm-grid2 input[type=color] { width: 100%; height: 30px; padding: 0 2px; }
.acm-grid2 label.acm-check { flex-direction: row; align-items: center; gap: 6px; }
.acm-el-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.acm-el-head h3 { margin: 0; }
.acm-el { border: 1px solid #dcdcde; border-radius: 6px; margin-bottom: 6px; background: #fafafa; }
.acm-el.is-selected { border-color: #2271b1; background: #fff; box-shadow: 0 0 0 1px #2271b1; }
.acm-el-title { padding: 8px 10px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.acm-el-title strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acm-el-tools .button-link { text-decoration: none; padding: 0 4px; font-size: 14px; }
.acm-el-tools .acm-del { color: #b32d2e; }
.acm-el-body { padding: 4px 10px 12px; border-top: 1px solid #eee; }
.acm-imgpick { display: flex; align-items: center; gap: 10px; }
.acm-imgpick img { max-width: 60px; max-height: 60px; border: 1px solid #ddd; background: #fff; }
.acm-ph code { cursor: pointer; display: inline-block; margin: 2px 0; }
.acm-ph code:hover { background: #2271b1; color: #fff; }

/* Send */
.acm-send { display: flex; gap: 20px; align-items: flex-start; }
.acm-send-main { flex: 1; min-width: 0; }
.acm-send-side { flex: 0 0 340px; position: sticky; top: 46px; }
.acm-modes { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.acm-modes label { border: 1px solid #dcdcde; border-radius: 6px; padding: 10px 14px; cursor: pointer; background: #fafafa; }
.acm-modes label:has(input:checked) { border-color: #2271b1; background: #f0f6fc; }
.acm-mode-box { display: none; background: #f6f7f7; border-radius: 6px; padding: 4px 12px; margin-bottom: 10px; }
.acm-chip { display: inline-block; background: #fff; border: 1px solid #dcdcde; border-radius: 16px; padding: 4px 10px; margin: 3px 2px; }
.acm-chip span { color: #888; }
.acm-picklist { max-height: 320px; overflow: auto; background: #fff; border: 1px solid #dcdcde; border-radius: 6px; margin-bottom: 10px; }
.acm-pick { display: block; padding: 6px 10px; border-bottom: 1px solid #f0f0f1; }
.acm-pick span { color: #777; font-size: 12px; }
.acm-recipients-summary { font-size: 14px; padding: 10px 12px; background: #f0f6fc; border-left: 4px solid #2271b1; }
.acm-bar { height: 12px; background: #f0f0f1; border-radius: 6px; overflow: hidden; }
.acm-bar span { display: block; height: 100%; width: 0; background: #2271b1; transition: width .3s; }
.acm-results { max-height: 380px; overflow: auto; margin-left: 18px; }
.acm-results li span { color: #777; font-size: 12px; }
.acm-results .ok, .acm-progress .ok { color: #1e7b34; }
.acm-results .bad, .acm-progress .bad { color: #b32d2e; }
.acm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 100000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.acm-overlay > div { max-width: 92vw; text-align: center; color: #fff; }
.acm-overlay img { max-width: 92vw; max-height: 80vh; box-shadow: 0 8px 40px rgba(0,0,0,.5); }

@media (max-width: 1100px) {
	.acm-editor, .acm-send, .acm-cols { flex-direction: column; }
	.acm-editor-panel, .acm-send-side, .acm-col-narrow { flex: auto; max-width: none; width: 100%; position: static; }
}
.acm-grid2 input, .acm-grid2 select, .acm-grid2 textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.acm-grid2 input[type=checkbox] { width: auto; }
.acm-editor-panel input.widefat { box-sizing: border-box; }

.acm-img-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acm-img-field-preview { width: 90px; height: 90px; object-fit: contain; border: 1px solid #dcdcde; border-radius: 6px; background: #fff; }
.acm-event-logo { width: 44px; height: 44px; object-fit: contain; }
.acm-grid2 input[type=range] { padding: 0; min-height: 0; border: 0; box-shadow: none; }
.acm-grid2 output { font-weight: 600; color: #1d2327; }
