:root {
  --paper:#f7f8fa;
  --ink:#20262e;
  --muted:#626b75;
  --green:#176b55;
  --border:#e1e5e9;
  --white:#fff;
  --red:#a73a3a;
  --shadow:none;
}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font:14px/1.6 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;-webkit-font-smoothing:antialiased}
[hidden]{display:none!important}
a{color:var(--green);text-decoration:none}
a:hover{text-decoration:underline}
button,.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid var(--green);border-radius:6px;background:var(--green);color:#fff;font:inherit;font-weight:600;cursor:pointer;text-decoration:none;box-shadow:none}
button:hover,.button:hover{background:#115441;border-color:#115441;text-decoration:none}
button:disabled{opacity:.55;cursor:wait}
.secondary{background:#fff;color:var(--ink);border-color:#d4d9de}
.secondary:hover{background:#f3f5f6;color:var(--ink);border-color:#bfc7cf}
.danger{background:#fff;color:var(--red);border-color:#e2c6c6}
.danger:hover{background:#fff4f4;color:var(--red);border-color:#ceabab}
input:not([type=checkbox]):not([type=hidden]),select,textarea{display:block;width:100%;min-height:44px;padding:10px 12px;background:#fff;border:1px solid #cdd3da;border-radius:6px;color:var(--ink);font:inherit}
input::placeholder{color:#87909b}
input[type=checkbox]{width:18px;height:18px;margin:0;accent-color:var(--green);vertical-align:middle}
textarea{resize:vertical}
label{display:block;margin-bottom:7px;color:#333c46;font-size:13px;font-weight:600}
label:has(input[type=checkbox]){font-weight:400}
input:focus,textarea:focus,select:focus{outline:2px solid #98c7b8;outline-offset:1px;border-color:var(--green)}
button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #98c7b8;outline-offset:3px}
h1,h2,h3,p{margin-top:0}
h1{font-size:28px;line-height:1.25;font-weight:650;letter-spacing:-.5px;margin-bottom:8px}
h2{font-size:18px;line-height:1.4;font-weight:600;letter-spacing:-.2px;margin-bottom:18px}
h3{font-size:16px;line-height:1.4;font-weight:600;letter-spacing:0;margin-bottom:10px}
p{margin-bottom:16px}
small,.small{font-size:13px}
small{display:block;color:var(--muted);margin-top:5px}
.muted,.helptext{color:var(--muted)}
.helptext{display:block;font-size:13px;line-height:1.6;margin:6px 0 0}
.eyebrow{display:block;font-size:12px;font-weight:600;letter-spacing:0;color:var(--muted);margin-bottom:8px}
.sidebar{position:fixed;inset:0 auto 0 0;z-index:10;width:224px;padding:26px 16px 18px;background:#fff;border-right:1px solid var(--border);display:flex;flex-direction:column}
.sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 8px 28px}
.brand,.login-brand{display:flex;align-items:center;gap:9px;color:var(--ink);font-size:20px;font-weight:650;letter-spacing:-.3px}
.brand:hover{text-decoration:none}
.brand-mark{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;margin:0;border-radius:5px;background:#eef4f1;color:var(--green);font-size:18px;font-weight:650}
.brand-sub,.nav-label,.operator-help{display:none}
.sidebar nav{display:grid;gap:3px}
.sidebar nav a{display:flex;align-items:center;gap:10px;min-height:42px;padding:9px 12px;border-radius:5px;color:#626b75;font-size:14px}
.sidebar nav a:hover{background:#f5f6f7;text-decoration:none;color:#20262e}
.sidebar nav a[aria-current=page]{background:#eef4f1;color:#165b48;font-weight:600}
.nav-icon{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.sidebar-foot{margin-top:auto;padding:18px 8px 0;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:8px}
.sidebar-foot>span{font-size:12px;color:var(--muted);max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar-foot form{margin:0}
.text-button{min-height:32px;padding:4px;border:0;border-radius:4px;background:none;color:var(--muted);font-size:13px;font-weight:500}
.text-button:hover{background:#f3f5f6;border:0;color:var(--ink)}
.menu-toggle{display:none}
.with-sidebar{margin-left:224px;max-width:1620px;min-height:100vh;padding:24px 32px}
.workspace-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:16px;margin-bottom:28px;border-bottom:1px solid var(--border);color:var(--muted);font-size:13px}
.workspace-event{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:80%}
.workspace-status{white-space:nowrap}
.status-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--green)}
.page-head{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 24px}
.page-head p{margin:0;font-size:14px}
.card{padding:24px;border:1px solid var(--border);border-radius:8px;background:#fff;box-shadow:none;min-width:0}
.columns{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);align-items:start;gap:24px}
.spaced{margin-top:24px}
.metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0 0 24px;background:#fff;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.metrics>div{padding:16px 20px;border-right:1px solid var(--border)}
.metrics>div:last-child{border-right:0}
.metrics span{display:block;font-size:13px;color:var(--muted)}
.metrics strong{display:block;font-size:30px;line-height:1.2;font-weight:600;color:var(--ink);margin-top:8px;font-variant-numeric:tabular-nums}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px;flex-wrap:wrap}
.section-head h2{margin:0}
.section-head>div{display:flex;align-items:center;gap:14px;font-size:13px;flex-wrap:wrap}
.filters{display:flex;align-items:center;gap:10px;margin:0 0 18px;padding:0;background:none;border:0}
.filters input{flex:2;min-width:0}
.filters select{flex:1;min-width:180px}
.filters button{white-space:nowrap}
.table-wrap{overflow-x:auto}
table{border-collapse:collapse;width:100%;white-space:nowrap;font-size:14px}
th{padding:12px;text-align:left;font-size:12px;font-weight:600;color:var(--muted);background:#f7f8fa;letter-spacing:0;text-transform:none}
td{padding:15px 12px;border-bottom:1px solid var(--border)}
th{border-bottom:1px solid var(--border)}
td:first-child,th:first-child{padding-left:10px}
td strong{font-size:14px;font-weight:600;color:var(--ink)}
tr:last-child td{border-bottom:0}
tbody tr:hover{background:#fcfcfd}
.badge{display:inline-flex;align-items:center;gap:6px;padding:3px 8px;border:1px solid #dce9e2;border-radius:4px;background:#f0f6f2;color:#37614b;font-size:12px;font-weight:500;line-height:1.6;white-space:nowrap}
.badge.pending{background:#fbf7ef;border-color:#ece3ce;color:#846523}
.badge.inactive{background:#f4f5f6;border-color:#e2e5e8;color:#68717b}
.batch{display:flex;justify-content:space-between;align-items:center;gap:18px;border-top:1px solid var(--border);padding-top:18px;margin-top:16px}
.batch label{margin:0;font-size:13px;color:var(--muted)}
.pagination{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;padding-top:20px;color:var(--muted);font-size:13px}
.grid-table input:not([type=hidden]){min-width:150px}
.grid-table td:last-child input{min-width:85px}
.empty{padding:36px 16px;text-align:center;color:var(--muted);white-space:normal}
.empty h3{color:#4c5661;font-size:16px}
.empty p{margin-bottom:12px}
.bulk-send{padding:16px 24px;background:#fff;box-shadow:none}
.bulk-send summary{color:var(--muted);padding:0;font-size:14px;font-weight:500}
.bulk-send form{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:18px;padding:0;background:none;border:0}
.bulk-send label{margin:0;font-size:13px}
.notice,.mode-banner{padding:12px 16px;margin:14px 0;border:1px solid #dfe7e2;border-radius:6px;background:#f2f6f3;color:#485e50;font-size:14px}
.mode-banner{background:#fbf8ef;color:#716034;border-color:#e8dfc5;margin:0 0 20px}
.notice.error,.errorlist{color:#913636;background:#fff5f5;border-color:#eccdcd}
.notice.success{background:#f0f7f2;color:#376449;border-color:#d4e6d9}
.errorlist{list-style:none;border:1px solid #eccdcd;padding:10px 12px;margin:8px 0 12px;border-radius:5px;font-size:13px}
.back{display:inline-block;font-size:13px;color:var(--muted);margin:0 0 18px}
.person-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;border-bottom:1px solid var(--border)}
.person-row:last-child{border:0}
.participant{border-top:1px solid var(--border);padding-bottom:12px}
details{margin:12px 0}
summary{padding:8px 0;color:var(--green);cursor:pointer;font-size:14px;font-weight:500}
details form{margin-top:12px;padding:18px;background:#fafbfc;border:1px solid var(--border);border-radius:6px}
.public-main{min-height:100vh;padding:32px 20px;background:#fff}
.public-content{max-width:720px;margin:0 auto}
.event-hero{padding:24px 0;text-align:center}
.event-hero h1{font-size:32px}
.public-content button{width:100%}
.public-content .participant button{width:auto}
.login-card{max-width:400px;padding:32px;margin:7vh auto}
.login-brand{margin-bottom:28px}
.login-card h1{font-size:24px}
.login-card form{margin-top:24px}
.login-card button{width:100%;margin-top:8px}
.login-card form p{margin-bottom:18px}
.ticket-card{max-width:660px;text-align:center;margin:0 auto}
.ticket-image{width:100%;height:auto;display:block;margin:20px auto;border-radius:6px}
.email-preview{padding:18px;margin-top:16px;background:#fafbfc;border:1px solid var(--border);border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.7 system-ui}
.email-frame{display:block;width:100%;height:600px;border:1px solid var(--border);border-radius:6px;background:#fff}
.scanner-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr);align-items:start;gap:24px;max-width:1100px}
.scanner-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.scanner-head h2{margin:0}
.camera-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;min-height:280px;padding:24px;margin-bottom:18px;background:#f7f8fa;border:1px solid var(--border);border-radius:6px;color:var(--muted);text-align:center}
.camera-empty strong{font-size:14px;font-weight:500;color:#505b66}
.camera-empty small{max-width:260px}
.qr-target{display:flex;align-items:center;justify-content:center;width:72px;height:72px;color:#8c98a1}
.qr-target svg{width:48px;height:48px;fill:none;stroke:currentColor;stroke-width:1.5}
.camera-actions button{width:100%;min-height:48px}
.camera-footnote{font-size:13px;color:var(--muted);margin:12px 0 0}
.manual-card form{margin-top:18px}
.manual-card button{width:100%;margin-top:16px}
.scanner-guide{padding:18px 0 0;border-top:1px solid var(--border);margin-top:22px;color:var(--muted);font-size:13px}
.scanner-guide p{margin:0}
.scanner-guide strong{font-weight:500;color:#4b5661}
#reader{width:100%;overflow:hidden;border-radius:6px;margin-bottom:18px}
#reader{min-height:0}
#reader video{max-height:450px;object-fit:cover}
.scan-result{margin-top:22px;padding:20px;border:1px solid #e5c8c8;border-radius:6px;background:#fff5f5;color:#913636}
.scan-result.valid{background:#eef7f0;border-color:#bbd9c6;color:#2d6543}
.scan-result.used{background:#fff9eb;border-color:#e8d7a8;color:#7a622c}
.scan-result.loading{background:#f5f7f8;border-color:#dce3e7;color:#4b5d66}
.scan-result h2{margin-bottom:12px}
.scan-result p{margin:10px 0 0}
footer{color:#78818b;font-size:12px;text-align:center;margin:32px 0 8px}
hr{border:0;border-top:1px solid var(--border);margin:24px 0}
.skip-link{position:fixed;left:-9999px;top:10px;z-index:100;padding:10px 16px;border:1px solid var(--border);border-radius:6px;background:#fff}
.skip-link:focus{left:16px}
@media(min-width:1450px){.with-sidebar{padding:28px 44px}}
@media(max-width:1100px){.columns,.scanner-grid{grid-template-columns:1fr}.with-sidebar{padding:24px}.filters{flex-wrap:wrap}}
@media(max-width:700px){
  .sidebar{position:static;width:100%;padding:14px 18px;border-right:0;border-bottom:1px solid var(--border)}
  .sidebar-head{margin:0}
  .brand{font-size:19px}
  .menu-toggle{display:inline-flex;min-height:40px;padding:7px 12px;font-size:13px}
  .sidebar nav{margin-top:14px;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
  .sidebar nav a{min-height:44px;padding:10px;font-size:14px;gap:8px}
  .sidebar.has-menu-toggle:not(.menu-open) nav,.sidebar.has-menu-toggle:not(.menu-open) .sidebar-foot{display:none}
  .sidebar-foot{margin-top:14px;padding-top:12px}
  .sidebar-foot>span{max-width:80%}
  .with-sidebar{margin:0;padding:20px 18px}
  .workspace-bar{margin-bottom:22px;padding-bottom:13px;font-size:12px}
  .page-head{gap:16px;flex-wrap:wrap;margin-bottom:20px}
  .page-head h1{font-size:26px}
  .card{padding:20px;border-radius:8px}
  .metrics{grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:20px}
  .metrics>div{padding:14px 16px}
  .metrics>div:nth-child(2){border-right:0}
  .metrics>div:nth-child(-n+2){border-bottom:1px solid var(--border)}
  .metrics strong{font-size:27px}
  .filters input,.filters select{flex:1 1 100%;min-width:0}
  .filters button{width:100%}
  .batch{align-items:stretch;flex-direction:column}
  .batch button{width:100%}
  .person-row{flex-wrap:wrap;gap:12px}
  .person-row>div{width:100%}
  .public-main{padding:24px 18px}
  .login-card{padding:26px;margin:5vh auto}
  .camera-empty{min-height:220px}
  .bulk-send{padding:16px 20px}
  .bulk-send form{display:grid;gap:16px}
  .bulk-send button{width:100%}
  .email-frame{height:530px}
}
