:root{--navy:#174784;--teal:#bd3e61;--gold:#d8ab39;--ink:#24323a;--muted:#687981;--bg:#eef2f1}
*{box-sizing:border-box}body{margin:0;background:var(--bg);font:16px/1.55 system-ui,Segoe UI,sans-serif;color:var(--ink)}
.shell{max-width:1020px;margin:32px auto;padding:20px}.card{background:#fff;border:1px solid #dbe3e1;border-radius:18px;padding:28px;box-shadow:0 12px 38px #173a4a12}
.brand{color:var(--teal);font-weight:800;letter-spacing:.12em;font-size:13px}.top{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}
h1{font-size:clamp(28px,4vw,42px);line-height:1.15;color:var(--navy);margin:8px 0 18px}h2{color:var(--navy)}label{display:block;font-weight:650;margin:15px 0 6px}
input{font:inherit;width:100%;padding:11px 12px;border:1px solid #cbd6d4;border-radius:9px;background:#fff}input[type=checkbox]{width:auto}
.check{display:flex;align-items:flex-start;gap:10px;font-weight:400;background:#f3f7f6;padding:14px;border-radius:10px}.check input{margin-top:5px}
.btn{display:inline-block;border:0;border-radius:9px;background:var(--teal);color:#fff;padding:12px 18px;font:inherit;font-weight:700;cursor:pointer;text-decoration:none}.btn.secondary{background:var(--navy)}
.btnrow{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}.muted{color:var(--muted)}.notice{border-left:4px solid var(--gold);padding:12px 15px;background:#fff8e9;border-radius:5px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:16px}.event{padding:18px;border:1px solid #dbe3e1;border-radius:12px}.event h3{margin:0;color:var(--navy)}
.logo{max-height:108px;max-width:230px;object-fit:contain}.certificate{background:linear-gradient(135deg,#f5f1e6 0%,#faf7ee 50%,#eef3ee 100%);print-color-adjust:exact;-webkit-print-color-adjust:exact;width:100%;aspect-ratio:297/210;min-height:0;border:0;outline:3px solid var(--teal);outline-offset:-17px;box-shadow:inset 0 0 0 5px #faf7ee,inset 0 0 0 8px var(--gold),inset 0 0 0 13px #f7f4ea,inset 0 0 0 15px #4b9a70,inset 0 0 0 19px #f7f4ea,inset 0 0 0 20px #426f9d;padding:42px 58px;display:grid;grid-template-rows:auto 1fr auto;text-align:center;position:relative;overflow:hidden}
.certificate>.background-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.62;z-index:0;pointer-events:none}
.certificate>.cert-head,.certificate>.cert-content{position:relative;z-index:2}.certificate>.sign{z-index:2}.certificate:before,.certificate:after{z-index:3}
.certificate:before,.certificate:after{content:"✦";position:absolute;color:var(--gold);font-size:29px;line-height:1}.certificate:before{top:24px;left:28px}.certificate:after{right:28px;bottom:24px}.cert-head{display:flex;align-items:center;justify-content:center;gap:44px}.cert-head .logo{max-width:220px}.cert-head .logo.secondary{max-width:220px;max-height:90px}.cert-title{font-family:Georgia,serif;font-size:43px;letter-spacing:.09em;color:var(--navy);margin:4px}.person{font-family:Georgia,serif;font-size:34px;color:var(--teal);border-bottom:1px solid var(--gold);display:inline-block;padding:8px 22px;text-transform:uppercase}
.cert-content{align-self:center}.sign{position:static;justify-self:end;align-self:end;width:230px;border-top:1px solid #718087;padding-top:6px;text-align:center}.sign img{max-height:58px;max-width:200px;object-fit:contain;display:block;margin:0 auto -14px;position:relative;z-index:3}.sign b,.sign span{position:relative;z-index:4}.small{font-size:13px}.legal{max-height:170px;overflow:auto;background:#f7faf9;padding:12px;border-radius:8px}
.shell:has(.admin-shell){max-width:1220px}.admin-shell{max-width:1180px;margin:0 auto}.admin-hero{background:linear-gradient(130deg,#174784,#1d5a78 62%,#bd3e61);color:#fff;border-radius:20px;padding:28px 32px;margin-bottom:20px;box-shadow:0 14px 34px #173a4a1a}.admin-hero h1{color:#fff;margin:8px 0 5px}.admin-hero p{margin:0;color:#e8f1f4}.admin-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}.admin-header .brand{color:#bd3e61}.admin-tabs{display:flex;gap:10px;flex-wrap:wrap;background:#fff;padding:9px;border:1px solid #dbe3e1;border-radius:14px;margin:0 0 20px;box-shadow:0 4px 18px #173a4a0a}.admin-tab{display:block;padding:11px 16px;border-radius:10px;color:#52646d;text-decoration:none;font-weight:700}.admin-tab:hover{background:#f2f6f5}.admin-tab.active{background:#174784;color:#fff}.admin-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:0 0 20px}.admin-stat{background:#fff;border:1px solid #dbe3e1;border-radius:14px;padding:16px 19px}.admin-stat strong{display:block;font-size:25px;line-height:1.2;color:#174784}.admin-stat span{font-size:13px;color:#687981}.admin-section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 16px}.admin-section-title h2{margin:0}.admin-section-title p{margin:3px 0 0}.admin-panel{background:#fff;border:1px solid #dbe3e1;border-radius:16px;padding:24px;margin:0 0 18px;box-shadow:0 8px 26px #173a4a0a}.admin-panel h2{margin-top:0}.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.profile-item{border:1px solid #e2e9e8;background:#fbfcfb;border-radius:13px;padding:16px}.profile-item label{margin-top:0}.profile-item img{display:block;max-width:100%;max-height:82px;object-fit:contain;object-position:left center;margin:8px 0}.profile-actions{display:flex;justify-content:flex-end;margin-top:18px}.event-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:16px}.event-card{background:#fff;border:1px solid #dbe3e1;border-radius:16px;padding:19px;box-shadow:0 6px 20px #173a4a09}.event-card h3{margin:0;color:#174784;font-size:19px;line-height:1.3}.event-meta{color:#687981;font-size:14px;margin:6px 0 12px}.event-status{display:inline-flex;align-items:center;gap:7px;border-radius:99px;padding:5px 11px;font-size:12px;font-weight:750;background:#edf5ef;color:#27734c}.event-status.closed{background:#f2f3f4;color:#687981}.event-status.archive{background:#fff4df;color:#8c6414}.event-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.event-actions .btn{padding:9px 12px;font-size:14px}.event-actions form{margin:0}.qr-inline{width:96px;height:96px;object-fit:contain;margin:10px 0 0;border:1px solid #edf0ef;border-radius:8px}.admin-empty{padding:26px;border:1px dashed #cbd6d4;border-radius:14px;text-align:center;color:#687981;background:#fbfcfb}.admin-note{font-size:13px;color:#687981;margin:12px 0 0}
.draw-settings{margin:22px 0;padding:16px;border:1px solid #dbe3e1;border-radius:12px;background:#fbfcfb}.draw-settings h3{margin:0 0 8px;color:#174784}.draw-prize-fields[hidden]{display:none}.prize-row{display:grid;grid-template-columns:minmax(0,1fr) 110px auto;gap:9px;margin:10px 0}.draw-event{margin-bottom:20px}.draw-prize{padding:15px 0;border-top:1px solid #e2e9e8}.winner-stage{padding:40px 20px;text-align:center;border-radius:16px;background:linear-gradient(135deg,#174784,#bd3e61);color:#fff}.winner-stage h1,.winner-stage h2{color:#fff}.winner-name{font-size:clamp(30px,6vw,58px);font-weight:850;min-height:1.4em}.draw-prize-winners{color:#27734c}
.draw-settings:has(.draw-toggle:checked) .draw-prize-fields{display:block!important}.reroll-inline{display:inline;margin-left:8px}.reroll-inline .btn{padding:5px 9px;font-size:13px}
.admin-page-bar{display:flex;justify-content:flex-end;margin:0 0 14px}.admin-page-bar a{display:inline-block;padding:9px 14px;border-radius:9px;background:#174784;color:#fff;text-decoration:none;font-weight:700}.admin-page-bar a:hover{background:#123967}
@media(max-width:700px){.admin-stats{grid-template-columns:1fr}.profile-grid{grid-template-columns:1fr}.admin-panel{padding:18px}.admin-hero{padding:22px}.admin-header{align-items:flex-start}.admin-tab{padding:9px 11px;font-size:14px}}
@page{size:A4 landscape;margin:0}
@media print{html,body{width:297mm;height:210mm;margin:0;padding:0;background:#fff;overflow:hidden}.shell{max-width:none;width:297mm;height:210mm;margin:0;padding:0}.card{width:297mm;height:210mm;border:0;border-radius:0;box-shadow:none;padding:0;margin:0}.print-hide{display:none!important}.certificate{width:297mm;height:210mm;min-height:210mm;aspect-ratio:auto;padding:24mm 25mm;page-break-inside:avoid;break-inside:avoid;outline-offset:-17mm}.cert-head{min-width:0;gap:30px}.cert-head .logo{max-width:220px;max-height:90px}.sign{position:static;justify-self:end;align-self:end;max-width:100%}.sign img{max-height:58px;max-width:200px;margin-bottom:-14px}}
@media print{body:has(.recovery-print-card){background:#fff}.shell:has(.recovery-print-card){max-width:none;width:auto!important;height:auto!important;margin:0!important;padding:0!important}.card.recovery-print-card{width:auto!important;height:auto!important;min-height:0!important;padding:24mm!important;margin:0!important;border:1px solid #9a7a2b!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:#111!important}.recovery-print-card .print-hide{display:none!important}.recovery-print-card .recovery-code{display:block;text-align:center;padding:14mm 8mm!important;border:2px solid #b28b2f!important;background:#fff8e6!important;font-size:24pt!important;letter-spacing:.08em;word-break:break-all}}
