/* PRECI Golf Stableford – Frontend-Styles */

.precigsf-box {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 18px;
	margin: 0 0 18px;
	box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.precigsf-subbox { background: #f8fafc; }
.precigsf-box h3 { margin: 0 0 14px; font-size: 19px; }
.precigsf-box h4 { margin: 18px 0 10px; font-size: 16px; }

.precigsf-warn { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.precigsf-login { border-color: #bfdbfe; background: #eff6ff; }
.precigsf-login-btn { text-decoration: none; display: inline-block; }

.precigsf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}
.precigsf-field { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: #334155; gap: 4px; }
.precigsf-field span { font-weight: 600; }
.precigsf-input {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 400;
	box-sizing: border-box;
}
.precigsf-input:focus { outline: 2px solid #2563eb; border-color: #2563eb; }

.precigsf-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.precigsf-btn {
	background: #1d4ed8; color: #fff; border: 0; border-radius: 8px;
	padding: 10px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.precigsf-btn:hover { background: #1e3a8a; }
.precigsf-btn-ghost { background: #eef2ff; color: #1d4ed8; }
.precigsf-btn-ghost:hover { background: #e0e7ff; }
.precigsf-check { font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }

.precigsf-msg { font-size: 14px; min-height: 1em; color: #334155; margin: 6px 0; }

.precigsf-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.precigsf-table caption { caption-side: top; text-align: left; font-weight: 600; padding: 6px 0; }
.precigsf-table th, .precigsf-table td { border: 1px solid #e2e8f0; padding: 7px 9px; text-align: center; }
.precigsf-table th { background: #f1f5f9; font-weight: 600; }
.precigsf-table tbody tr:nth-child(odd) { background: #fafcff; }

.precigsf-cell { width: 64px; padding: 6px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: center; font-size: 14px; box-sizing: border-box; }

.precigsf-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 12px 0; }
.precigsf-kv { background: #f1f5f9; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.precigsf-k { font-size: 12px; color: #64748b; }
.precigsf-v { font-size: 20px; font-weight: 700; color: #0f172a; }

.precigsf-hint { font-size: 13px; color: #64748b; margin: 8px 0; }

/* Loch-Eingabe: Desktop Raster, Mobil vertikal */
.precigsf-holes-table th, .precigsf-holes-table td { padding: 5px; }

@media (max-width: 640px) {
	.precigsf-holes-table { display: block; }
	.precigsf-cell { width: 100%; }
	.precigsf-summary { grid-template-columns: 1fr 1fr; }
}

/* Druckansicht */
@media print {
	.precigsf-actions, .precigsf-input, .precigsf-msg { display: none !important; }
	.precigsf-box { box-shadow: none; border: none; }
	.precigsf-table th, .precigsf-table td { border: 1px solid #000; }
}

/* Welle 2: Platz-Autocomplete, Checkbox-Zeile, readonly-Platzfelder */
.precigsf-autolist { display: flex; flex-direction: column; gap: .25rem; margin: .25rem 0; }
.precigsf-autolist .precigsf-btn { text-align: left; }
.precigsf-checkrow { margin: .5rem 0; }
.precigsf-link { text-decoration: underline; cursor: pointer; }
.precigsf-input[readonly] { background: #f3f4f6; color: #4b5563; cursor: not-allowed; }
.precigsf-cell[readonly] { background: #f3f4f6; color: #4b5563; }

/* Welle 3: Modal (Erweiterte Suche), Advanced-Aufklappen */
.precigsf-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 99999; padding: 1rem; }
.precigsf-modal { background: #fff; border-radius: 8px; max-width: 720px; width: 100%; max-height: 85vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.precigsf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #e5e7eb; }
.precigsf-modal-head h4 { margin: 0; }
.precigsf-modal-body { padding: 1rem; }
.precigsf-advanced { margin: .5rem 0; }
.precigsf-advanced > summary { cursor: pointer; color: #6b7280; font-size: .9em; }

/* Pflichtfeld-Markierung und Feldfehler */
.precigsf-req { color: #dc2626; font-weight: 700; }
.precigsf-fielderr { display: block; color: #dc2626; margin-top: .15rem; }
.precigsf-input-error { border-color: #dc2626 !important; outline-color: #dc2626; }

/* Welle 4: zusammengeführte Scorecard-Tabelle */
.precigsf-holes-table th { vertical-align: bottom; line-height: 1.1; }
.precigsf-result-cell { background: #f9fafb; color: #111827; text-align: center; }
.precigsf-sumrow td { font-weight: 700; border-top: 2px solid #d1d5db; }
.precigsf-hcpline { display: flex; gap: 1.5rem; margin: .5rem 0; flex-wrap: wrap; }
.precigsf-hcp-item { font-weight: 600; }

/* Welle 4.1: Scorecard – zentriert, inhaltsabhängige Breite, 15px H-Padding */
.precigsf-holes-table { width: auto; margin-left: auto; margin-right: auto; table-layout: auto; }
.precigsf-holes-table th, .precigsf-holes-table td { padding: 5px 15px; white-space: nowrap; }
.precigsf-holes-table .precigsf-cell { width: auto; min-width: 0; max-width: 5ch; padding: 6px 8px; }
.precigsf-hcpline { justify-content: center; }
