* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; background: #f3f4f6; color: #111827; }
.hidden { display: none !important; }
button { cursor: pointer; border: 1px solid #cbd5e1; background: #fff; border-radius: 6px; padding: 7px 12px; font-size: 14px; }
button:hover { background: #f1f5f9; }
button.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
button.primary:hover { background: #1d4ed8; }
button.ghost { background: transparent; border-color: transparent; }
button:disabled { opacity: .6; cursor: wait; }
input, select { font-size: 14px; padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 6px; }

.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.login-box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 12px; width: 300px; }
.login-box h1 { margin: 0 0 6px; font-size: 20px; text-align: center; }
.err { color: #dc2626; font-size: 13px; min-height: 16px; margin: 0; }

header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e5e7eb; }
header h1 { font-size: 19px; margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hint { margin: 10px 20px 0; font-size: 13px; color: #6b7280; }
#status { margin: 8px 20px; font-size: 14px; color: #374151; }

#cards { display: flex; flex-wrap: wrap; gap: 18px; padding: 10px 20px 40px; align-items: flex-start; }
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.08); width: 340px; overflow: hidden; }
.sheet { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet th, .sheet td { border: 1px solid #9ca3af; padding: 5px 8px; }
.sheet th { font-weight: bold; text-align: center; }
.sheet td.lbl { text-align: center; }
.sheet td.val { text-align: right; font-variant-numeric: tabular-nums; cursor: copy; white-space: nowrap; }
.sheet td.val:hover { outline: 2px solid #2563eb; outline-offset: -2px; }
.greenbet .sheet th { background: #f6c94c; }
.greenbet .sheet tr.api td { background: #a9c4eb; }
.beting .sheet th { background: #8e7cc3; color: #fff; }
.beting .sheet tr.api td { background: #a9c4eb; }
.sheet tr.hgrow td { background: #d9ead3; }
.card-foot { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; gap: 6px; }
.card-foot .badge { font-size: 12px; color: #6b7280; }
button.hgbtn { background: #d9ead3; border-color: #93c47d; }
button.hgbtn:hover { background: #c6e0bd; }
.card .error { color: #b91c1c; font-size: 13px; padding: 8px 10px; background: #fef2f2; }
.card .warn { color: #92400e; font-size: 12px; padding: 6px 10px; background: #fffbeb; }
details { font-size: 12px; padding: 0 10px 10px; color: #374151; }
details pre { white-space: pre-wrap; background: #f9fafb; padding: 6px; border-radius: 4px; max-height: 220px; overflow: auto; }
.loading { padding: 30px; text-align: center; color: #6b7280; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; padding: 40px 10px; overflow: auto; z-index: 10; }
.modal-box { background: #fff; border-radius: 10px; padding: 18px 22px; width: 760px; max-width: 100%; }
.modal-head { display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; font-size: 18px; }
.plist { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.plist th, .plist td { border-bottom: 1px solid #e5e7eb; padding: 6px; text-align: left; }
.plist td.act { text-align: right; white-space: nowrap; }
.plist .test-res { font-size: 12px; color: #374151; }
.pform { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.pform label { display: flex; flex-direction: column; font-size: 13px; gap: 4px; color: #374151; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.msg { grid-column: 1 / -1; font-size: 13px; margin: 0; min-height: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 14px; z-index: 20; }
@media (max-width: 640px) { .pform { grid-template-columns: 1fr; } .card { width: 100%; } }
