:root{
  --bg:#f5f7fb; --surface:#ffffff; --text:#111827; --muted:#6b7280;
  --primary:#4b5563; --primary-600:#374151; --border:#e5e7eb; --ring:#93c5fd;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);}
header{position:sticky;top:0;z-index:20;background:#0f172a;color:#fff;box-shadow:0 2px 12px rgba(0,0,0,.15)}
.header-inner{max-width:1100px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;padding:12px 16px}
header h1{margin:0;font-size:18px;font-weight:700;letter-spacing:.2px}
header nav a{color:#e5e7eb;margin-left:12px;text-decoration:none;padding:6px 10px;border-radius:8px;transition:.15s;border:1px solid transparent}
header nav a:hover{background:#111827;border-color:#374151;color:#fff}
main{max-width:1100px;margin:20px auto;background:var(--surface);padding:22px;border-radius:14px;box-shadow:0 10px 30px rgba(0,0,0,.06)}
h2{margin-top:0}
label{display:block;margin:10px 0 6px;color:var(--muted);font-size:14px}
input,select,button{width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:10px;font-size:16px;background:#fff;color:var(--text);outline:none}
input:focus,select:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--ring)}
button,.btn{display:inline-block;width:auto;background:var(--primary);color:#fff;border:none;border-radius:10px;padding:10px 14px;font-weight:600;cursor:pointer;transition:.15s}
button:hover,.btn:hover{background:var(--primary-600);transform:translateY(-1px)}
.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:10px 0 18px}
.card{background:#f9fafb;border:1px solid var(--border);border-radius:12px;padding:14px}
.card .num{font-size:22px;font-weight:700}
table{width:100%;border-collapse:collapse;border:1px solid var(--border);border-radius:12px;overflow:hidden}
th,td{border-bottom:1px solid var(--border);padding:12px;text-align:left}
tr:hover td{background:#f9fbff}
.flash{margin:10px 0}
.flash-msg{padding:10px 12px;border-radius:10px;background:#eef2ff;border:1px solid #c7d2fe}
fieldset{border:1px solid var(--border);padding:14px;border-radius:12px;margin:14px 0}
.qr img{image-rendering:pixelated;border:8px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.hint{color:var(--muted);margin-top:10px}
footer{text-align:center;color:#6b7280;margin:16px}
.no-print{}
@media (max-width:760px){
  .grid{grid-template-columns:repeat(2,1fr)}
  header .header-inner{padding:10px 12px}
  main{margin:12px auto;padding:16px;border-radius:12px}
}
nav.top-right{margin-left:auto;display:flex;gap:8px}
.brand-link{color:#fff;text-decoration:none}
.menu-dropdown{ position:relative; margin-left:8px; }
.menu-dropdown summary{ list-style:none; cursor:pointer; font-weight:700; padding:6px 10px; border:1px solid #3f4550; border-radius:8px; }
.menu-dropdown[open] summary{ background:#111827; color:#fff; }
.menu-dropdown .menu-items{ position:absolute; right:0; margin-top:6px; background:#0f172a; border:1px solid #374151; border-radius:10px; min-width:180px; box-shadow:0 10px 30px rgba(0,0,0,.25); padding:8px; z-index:50; }
.menu-dropdown .menu-items a{ display:block; color:#e5e7eb; text-decoration:none; padding:8px 10px; border-radius:8px; }
.menu-dropdown .menu-items a:hover{ background:#111827; }
.menu-dropdown .menu-items a.danger{ color:#ff9aa9; }
.menu-dropdown.main{ display:flex; align-items:center; }
.menu-dropdown.main summary{ font-size:18px; line-height:1 }
.menu-dropdown[open] .menu-items{ display:block }
.menu{ position:relative; display:inline-block; }
.menu-trigger{
  cursor:pointer; font-weight:700; padding:8px 12px;
  border:1px solid #3f4550; border-radius:8px; background:transparent; color:inherit;
}
.menu-items{
  display:none; position:absolute; right:0; margin-top:8px;
  background:#0f172a; border:1px solid #374151; border-radius:10px; min-width:220px;
  box-shadow:0 10px 30px rgba(0,0,0,.25); padding:8px; z-index:1000;
}
.menu:hover .menu-items{ display:block; }
.menu-items hr{ border:0; height:1px; background:#374151; margin:8px 0; }
@media (max-width: 760px){ .menu-items{ min-width:70vw; } }
.menu-items a.danger { color:#ef4444; }
.menu-items a.danger:hover { background:#7f1d1d; color:#fff; }
.btn.secondary{
  font-size: 0.9rem; padding: 6px 10px; border-radius: 8px; border: 1px solid #4b5563; background: transparent; color: #9ca3af;
}
.btn.secondary:hover{ color:#e5e7eb; border-color:#6b7280; background: rgba(255,255,255,0.03); }
.backlink{
  display:inline-flex; gap:.5rem; align-items:center; font-size:0.95rem; color:#9ca3af; text-decoration:none; padding:4px 8px; border:1px solid #4b5563; border-radius:8px; background:transparent;
}
.backlink:hover{ color:#e5e7eb; border-color:#6b7280; background:rgba(255,255,255,0.03); }
.stats{display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin:10px 0 16px}
.stats .card{padding:10px 12px; border-radius:10px; background:var(--surface); border:1px solid var(--border); box-shadow:0 6px 20px rgba(0,0,0,.04)}
.stats .num{font-weight:800; font-size:22px}
.hero{position:relative; padding:80px 24px; border-radius:14px; color:#fff; overflow:hidden; background:#000}
.hero::before{content:""; position:absolute; inset:0; background:url('/static/img/landing_bg.jpg') center/cover no-repeat; opacity:.5; filter:contrast(1.05) saturate(1.2)}
.hero-inner{position:relative; max-width:900px; margin:0 auto; text-align:center}
.hero h1{font-size:42px; margin:0 0 10px}
.hero p{opacity:.95; max-width:720px; margin:0 auto 0}
.events-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; margin-top:16px}
.event-card{transition:transform .18s ease, box-shadow .18s ease}
.event-card:hover{transform:translateY(-3px); box-shadow:0 14px 28px rgba(0,0,0,.08)}
.event-head h3{margin:0}
.event-head .date{font-weight:600}
.qr-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; align-items:center; margin:10px 0 8px}
.qr-item{text-align:center; background:var(--bg); border:1px dashed var(--border); border-radius:12px; padding:10px}
.qr-title{font-weight:700; margin-bottom:6px}
.badge.cash{background:#fde68a}
.nowrap{white-space:nowrap}
.countdown{display:grid; grid-template-columns:repeat(4, minmax(70px,1fr)); gap:16px; margin:12px 0 18px; align-items:stretch}
.countdown div{display:flex; flex-direction:column; align-items:center; justify-content:center; padding:8px 6px; background:var(--surface); border:1px solid var(--border); border-radius:10px}
.countdown .num{font-size:36px; font-weight:800; line-height:1}
.countdown .lbl{font-size:12px; color:var(--muted)}
.table{width:100%; border-collapse:collapse; table-layout:auto !important; min-width:500px}
.table th,.table td{padding:8px 10px; border-bottom:1px solid var(--border); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:middle}
.table-wrap{overflow:auto; width:100%;}
td.nowrap, td.actions{ white-space:nowrap; overflow:visible !important; }
td.actions form.inline, td.nowrap form.inline{ display:inline-flex; align-items:center; gap:8px; flex-wrap:nowrap; }
td.actions select, td.nowrap select{ max-width:220px; }
@media (max-width: 900px){ td.actions select, td.nowrap select{ max-width:140px; } }
.filters{ display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; align-items: center; }
.filters label.inline{ display:flex; align-items:center; gap:6px; white-space:nowrap; }
@media (max-width: 900px){ .filters{ grid-template-columns: 1fr 1fr; } }
.table td:nth-child(1), .table th:nth-child(1){ max-width: 220px; }
.table td:nth-child(2), .table th:nth-child(2){ max-width: 240px; }
.table td:nth-child(3), .table th:nth-child(3){ max-width: 160px; }
.table td:nth-child(1), .table td:nth-child(2), .table td:nth-child(3){ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge{display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; font-weight:700; line-height:1; border:1px solid var(--border); background:#f3f4f6; color:#111827; margin-right:6px}
.badge.status.paid, .badge.ok, .badge.green { background:#dcfce7; border-color:#86efac; color:#065f46 }
.badge.status.pending_payment, .badge.orange { background:#fef9c3; border-color:#fde68a; color:#92400e }
.badge.status.created { background:#e0e7ff; border-color:#c7d2fe; color:#3730a3 }
.badge.status.cancelled, .badge.red { background:#fee2e2; border-color:#fecaca; color:#7f1d1d }
.badge.pink { background:#fde2f3; color:#9d174d; }
.badge.gray { background:#e5e7eb; color:#374151; }
.btn.danger { background-color: #dc2626 !important; color: #fff !important; border: none !important; }
.btn.danger:hover { background-color: #b91c1c !important; }
.btn.small.danger { padding: 4px 8px; font-size: 0.85em; border-radius: 4px; }
.settings-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; max-width: 520px; }
.option-row { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.option { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.option input { width: 16px; height: 16px; }
.round-edit-form { display:contents; }
.info-box { background:#f9fafb; border:1px solid #e5e7eb; padding:10px 14px; border-radius:10px; margin-bottom:12px; }
.info-box.closed { background:#fff1f2; border-color:#fecaca; color:#7f1d1d; }
.disabled-form { opacity: 0.6; pointer-events: none; }
.hl-yellow { background:#fffbd1 !important; }
.hint { margin-left:6px; font-size:12px; color:#92400e; background:#fff7ed; padding:1px 6px; border-radius:999px; }
