/* GES Simple Database - Layout & Komponenten.
   Ersetzt das frühere Inline-<style>-Fragment sowie die vielen bgcolor/width/align/
   border-Attribute im HTML. Mobile-first: Basis-Regeln gelten für Smartphones,
   Media Queries erweitern für Tablet/Desktop. */

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 1rem;
	background-color: #1c1c1c;
	color: #1a1a1a;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}

a {
	color: #0b5fa5;
}

.app-header {
	color: #f0f0f0;
	text-align: center;
	margin: 0 0 1rem;
	font-size: 1.1rem;
}

.app-footer {
	color: #888;
	text-align: center;
	font-size: 0.75rem;
	margin-top: 1.5rem;
}

/* Zentrale Inhalts-"Karte" ersetzt <center><table bgcolor="FFFFFF" border> */
.card {
	background: #ffffff;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 0.75rem;
	margin: 0 auto 1rem;
	max-width: 100%;
	width: 100%;
}

.card + .card {
	margin-top: 1rem;
}

.card-title {
	font-weight: bold;
	margin-bottom: 0.5rem;
}

.card-inner {
	background: #fffff0;
	border: 1px solid #ddd;
	border-radius: 4px;
	padding: 0.5rem;
}

/* Aktions-/Button-Leisten: umbrechen statt Layout zu sprengen */
.action-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin: 0.4rem 0;
}

.form-inline {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
}

.filter-bar {
	margin: 0.4rem 0 0.8rem;
}

.pagination-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
	width: 100%;
	margin: 0.6rem 0;
	justify-content: space-between;
}

/* Eingabefelder */
.input-text,
select.select {
	min-height: 2.4rem;
	padding: 0.3rem 0.5rem;
	font-size: 1rem;
	font-family: Arial, sans-serif;
	border: 1px solid #666;
	border-radius: 3px;
	background: #fffff3;
	color: #000;
	max-width: 100%;
}

select.select {
	background: #fff;
}

label {
	font-size: 0.9rem;
}

/* Buttons */
.btn {
	display: inline-block;
	min-height: 2.6rem;
	padding: 0.5rem 1rem;
	font-size: 1rem;
	font-family: Arial, sans-serif;
	font-weight: bold;
	border: 1px solid #000;
	border-radius: 4px;
	background: #e5e5e5;
	color: #000;
	cursor: pointer;
}

.btn:hover {
	filter: brightness(0.95);
}

.btn-primary {
	background: #2e7d32;
	color: #fff;
	border-color: #1b5e20;
}

.btn-danger {
	background: #c62828;
	color: #fff;
	border-color: #8e0000;
}

.btn-link {
	background: none;
	border: none;
	color: #0b5fa5;
	text-decoration: underline;
	padding: 0.4rem;
	min-height: auto;
}

.icon-link {
	text-decoration: none;
	font-size: 1.1rem;
	padding: 0.2rem 0.35rem;
}

.icon-link:hover {
	filter: brightness(0.7);
}

/* Datentabellen: horizontal scrollbar statt zu brechen/zu quetschen */
.table-wrap {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

table.data-table {
	border-collapse: collapse;
	width: 100%;
	min-width: 480px;
}

table.data-table th,
table.data-table td {
	border: 1px solid #ccc;
	padding: 0.4rem 0.5rem;
	text-align: left;
	white-space: nowrap;
}

table.data-table th {
	background: #f4f4f4;
}

table.data-table tr:nth-child(even) {
	background: #f7f7f7;
}

.row-error {
	color: #c62828;
	font-weight: bold;
}

.message {
	padding: 0.6rem;
	border-radius: 4px;
	margin: 0.5rem 0;
}

.message-error {
	background: #fdecea;
	border: 1px solid #c62828;
	color: #8e0000;
}

.message-success {
	background: #eaf6ea;
	border: 1px solid #2e7d32;
	color: #1b5e20;
}

.debug-box {
	background: #fbffff;
	border: 1px solid #ccc;
	padding: 0.5rem;
	margin-top: 1rem;
	font-size: 0.8rem;
	word-break: break-all;
}

/* Bild-/Dokument-Felder */
.thumb-img {
	max-height: 60px;
	max-width: 90px;
	object-fit: cover;
	border: 1px solid #666;
	border-radius: 4px;
	cursor: zoom-in;
	display: block;
}

.lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	z-index: 1000;
	align-items: center;
	justify-content: center;
	cursor: zoom-out;
	padding: 2rem;
}

.lightbox img {
	max-width: 100%;
	max-height: 100%;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

/* Tablet und größer */
@media (min-width: 700px) {
	body {
		padding: 1.5rem;
	}

	.card {
		max-width: 90%;
	}

	.input-text {
		min-width: 220px;
	}
}

/* Desktop */
@media (min-width: 1100px) {
	.card {
		max-width: 1100px;
	}

	table.data-table th,
	table.data-table td {
		white-space: normal;
	}
}
