*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,"PingFang SC","Microsoft YaHei",sans-serif;background:#f3f6fb;color:#162033}
.layout{display:flex;min-height:100vh}
.sidebar{width:240px;background:#111827;color:#fff;padding:24px 16px;display:flex;flex-direction:column;gap:10px}
.sidebar .brand{font-size:22px;font-weight:700;margin-bottom:18px}
.sidebar a{color:#cbd5e1;text-decoration:none;padding:10px 12px;border-radius:10px}
.sidebar a:hover{background:#1f2937;color:#fff}
.main{flex:1;padding:20px;overflow:auto}
.topbar{display:flex;justify-content:space-between;align-items:center;background:#fff;border-radius:14px;padding:16px 20px;box-shadow:0 6px 24px rgba(15,23,42,.06);margin-bottom:20px}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.card{background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 24px rgba(15,23,42,.06)}
.card h3{margin:0 0 10px}
.value{font-size:28px;font-weight:800}
.table-wrap{background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 24px rgba(15,23,42,.06);overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:12px;border-bottom:1px solid #e5e7eb;text-align:left;font-size:14px;vertical-align:top}
input[type=text],input[type=number],input[type=password],input[type=datetime-local],input[type=file],textarea,select{width:100%;padding:10px 12px;border:1px solid #cbd5e1;border-radius:10px;background:#fff}
textarea{min-height:120px;resize:vertical}
.btn{display:inline-block;padding:10px 16px;background:#2563eb;color:#fff;text-decoration:none;border:none;border-radius:10px;cursor:pointer}
.btn-secondary{background:#475569}
.btn-danger{background:#dc2626}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.alert{padding:12px 14px;border-radius:12px;margin-bottom:16px}
.alert-success{background:#dcfce7;color:#166534}
.alert-error{background:#fee2e2;color:#991b1b}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#1d4ed8)}
.login-card{width:420px;max-width:92vw;background:#fff;border-radius:18px;padding:30px;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.form-row{margin-bottom:14px}
.muted{color:#64748b;font-size:13px;line-height:1.7}
.pill{display:inline-block;padding:4px 10px;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:12px}
.inline-form{display:inline-block;margin:0}
code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
ul{margin:10px 0 0 18px}

.voucher-thumb{display:block;width:140px;max-width:100%;height:auto;border-radius:12px;border:1px solid #cbd5e1;box-shadow:0 6px 18px rgba(15,23,42,.10);background:#fff;object-fit:cover}


.voucher-preview-btn{display:inline-flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;cursor:pointer}
.voucher-thumb--small{width:72px!important;height:72px!important;max-width:none!important;object-fit:cover;border-radius:10px;border:1px solid #cbd5e1;box-shadow:0 4px 12px rgba(15,23,42,.12);background:#fff}
.voucher-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:9999}
.voucher-modal.is-open{display:flex}
.voucher-modal__backdrop{position:absolute;inset:0;background:rgba(2,6,23,.72)}
.voucher-modal__dialog{position:relative;z-index:1;max-width:min(92vw,1000px);max-height:92vh;padding:18px;border-radius:16px;background:#fff;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.voucher-modal__image{display:block;max-width:min(88vw,960px);max-height:80vh;width:auto;height:auto;object-fit:contain}
.voucher-modal__close{position:absolute;top:10px;right:10px;width:36px;height:36px;border:none;border-radius:999px;background:#0f172a;color:#fff;font-size:26px;line-height:1;cursor:pointer}


.grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.compact-grid label{display:block;font-size:13px;font-weight:600;color:#334155}
.compact-grid input,.compact-grid select{margin-top:6px}
.level-card{background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 24px rgba(15,23,42,.06);margin-bottom:20px}
.level-card__head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}
.level-card__title{margin-left:10px;font-size:18px}
.drop-config{margin-top:18px;border:1px solid #e5e7eb;border-radius:14px;overflow:hidden}
.drop-config__toolbar{padding:14px 16px;background:#f8fafc;border-bottom:1px solid #e5e7eb;display:flex;flex-direction:column;gap:6px}
.drop-config__table-wrap{overflow:auto}
.drop-config__table th,.drop-config__table td{white-space:nowrap}
.drop-config__table input[type=number]{min-width:96px}
.level-card__raw-json{margin-top:14px}
.level-card__raw-json summary{cursor:pointer;font-weight:600;color:#1d4ed8}
.level-card__raw-json textarea{margin-top:10px;min-height:100px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
@media (max-width: 1200px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 768px){.grid-4{grid-template-columns:1fr}.level-card__head{flex-direction:column;align-items:flex-start}}

.search-card{margin-bottom:18px}
.search-form{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.search-form input[type=text]{max-width:520px}
.pager{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.pager-link{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;padding:0 12px;border-radius:10px;background:#e2e8f0;color:#0f172a;text-decoration:none}
.pager-link.is-active{background:#2563eb;color:#fff}
