/* Private Buchhaltung Pro - Frontend-Styles
   Mobil-freundlich, einfach und schnell bedienbar. */

.pbap-app {
	max-width: 900px;
	margin: 0 auto;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
}

.pbap-app * {
	box-sizing: border-box;
}

/* ---- Kopfbereich ---------------------------------------------------- */

.pbap-topbar {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid #ddd;
	margin-bottom: 10px;
	font-size: 13px;
	color: #555;
}

.pbap-live-status {
	font-size: 12px;
	color: #888;
}

.pbap-live-status.is-updated {
	color: #1a7f37;
	font-weight: 600;
}

/* ---- Hinweise -------------------------------------------------------- */

.pbap-notice {
	background: #e7f7ed;
	border: 1px solid #b6e3c6;
	color: #1a7f37;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 12px;
}

/* ---- Tabs -------------------------------------------------------------- */

.pbap-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: 14px;
	border-bottom: 2px solid #e2e2e2;
}

.pbap-tab {
	padding: 8px 14px;
	text-decoration: none;
	color: #555;
	border-radius: 4px 4px 0 0;
	font-weight: 600;
}

.pbap-tab.is-active {
	background: #2271b1;
	color: #fff;
}

/* ---- Organisation-Auswahl ---------------------------------------------- */

.pbap-org-switch {
	margin-bottom: 14px;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.pbap-org-switch select {
	padding: 6px 8px;
	font-size: 14px;
}

/* ---- Karten (Kennzahlen) ------------------------------------------------ */

.pbap-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 12px 0 20px;
}

.pbap-card {
	background: #f7f7f7;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 12px 16px;
	flex: 1 1 160px;
	min-width: 140px;
}

.pbap-card h3 {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 600;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.pbap-amount {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
}

.pbap-income {
	color: #1a7f37;
}

.pbap-expense {
	color: #c0392b;
}

.pbap-muted {
	color: #888;
	font-size: 12px;
}

/* ---- Tabellen ------------------------------------------------------------ */

.pbap-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 24px;
	font-size: 14px;
}

.pbap-table th,
.pbap-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: top;
}

.pbap-table th {
	background: #f5f5f5;
	font-weight: 600;
}

.pbap-row-actions a,
.pbap-link-delete {
	font-size: 13px;
	margin-right: 8px;
}

.pbap-link-delete {
	background: none;
	border: none;
	color: #c0392b;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

.pbap-row-actions form {
	display: inline;
}

/* ---- Formulare ------------------------------------------------------------ */

.pbap-form {
	background: #f9f9f9;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	padding: 14px;
	margin-bottom: 24px;
}

.pbap-form-row {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 12px;
}

.pbap-form-row label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-weight: 600;
	font-size: 13px;
	flex: 1 1 160px;
}

.pbap-form-row input[type="text"],
.pbap-form-row input[type="number"],
.pbap-form-row input[type="date"],
.pbap-form-row select {
	padding: 8px;
	font-size: 15px;
	font-weight: normal;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.pbap-note-field {
	flex: 1 1 100% !important;
}

.pbap-checkbox {
	flex-direction: row !important;
	align-items: center;
	gap: 6px !important;
}

.pbap-form-actions {
	display: flex;
	gap: 8px;
}

/* ---- Plus/Minus-Umschalter -------------------------------------------------- */

.pbap-type-toggle {
	display: flex;
	gap: 10px;
	margin-bottom: 14px;
}

.pbap-toggle {
	flex: 1;
	text-align: center;
	border: 2px solid #ddd;
	border-radius: 6px;
	padding: 14px;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
	background: #fff;
}

.pbap-toggle input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.pbap-toggle-expense span {
	color: #c0392b;
}

.pbap-toggle-income span {
	color: #1a7f37;
}

.pbap-toggle:has(input:checked) {
	border-color: currentColor;
	background: #fff8f6;
}

.pbap-toggle-income:has(input:checked) {
	background: #f3fbf5;
}

/* Kategorie-Felder werden je nach Buchungstyp ein-/ausgeblendet (siehe JS). */
.pbap-cat-select {
	display: none;
}

.pbap-cat-select.is-visible {
	display: flex;
}

/* ---- Buttons ---------------------------------------------------------------- */

.pbap-btn {
	display: inline-block;
	padding: 10px 18px;
	border-radius: 4px;
	border: 1px solid #ccc;
	background: #fff;
	color: #333;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	cursor: pointer;
}

.pbap-btn-primary {
	background: #2271b1;
	border-color: #2271b1;
	color: #fff;
}

/* ---- Mobile-Anpassungen ------------------------------------------------------ */

@media (max-width: 600px) {
	.pbap-tab {
		flex: 1 1 45%;
		text-align: center;
	}

	.pbap-table,
	.pbap-table thead,
	.pbap-table tbody,
	.pbap-table th,
	.pbap-table td,
	.pbap-table tr {
		display: block;
	}

	.pbap-table thead {
		display: none;
	}

	.pbap-table tr {
		border: 1px solid #eee;
		border-radius: 6px;
		margin-bottom: 10px;
		padding: 6px 10px;
	}

	.pbap-table td {
		border: none;
		padding: 4px 0;
	}

	.pbap-table td::before {
		content: attr(data-label);
		font-weight: 600;
		display: inline-block;
		min-width: 110px;
		color: #666;
	}
}
