/* PDF Office (Docker) – Grundgerüst der Seiten: Kopfzeile, Gastseiten, Hinweise, Dateiauswahl */
:root {
	--pdfo-host-accent: #8a3a2e;
	--pdfo-host-accent-dark: #6e2a22;
	--pdfo-host-accent-soft: #f5e9e6;
	--pdfo-host-text: #222;
	--pdfo-host-muted: #6b6b6b;
	--pdfo-host-border: #ddd5d2;
	--pdfo-host-bg: #faf7f6;
	--pdfo-host-card: #fff;
	--header-height: 46px;
	/* Variablen, die Nextcloud-Seiten sonst bereitstellen */
	--color-main-background: #ffffff;
	--color-main-text: #222222;
	--color-text-maxcontrast: #6b6b6b;
	--color-border: #ddd5d2;
	--color-background-hover: #f3eeec;
	--color-primary: #8a3a2e;
	--color-primary-element: #8a3a2e;
	--color-primary-element-text: #ffffff;
	--color-primary-element-light: #f5e9e6;
	--color-primary-element-hover: #6e2a22;
	--color-success: #2d7b3f;
	--color-error: #b3261e;
	--color-warning: #a86400;
	--color-warning-hover: #8a5200;
	--border-radius: 6px;
	--border-radius-large: 10px;
	--default-font-size: 15px;
	--font-face: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
	:root {
		--pdfo-host-text: #eee;
		--pdfo-host-muted: #a9a9a9;
		--pdfo-host-border: #3d3533;
		--pdfo-host-bg: #1c1918;
		--pdfo-host-card: #262220;
		--pdfo-host-accent-soft: #3a2723;
		--color-main-background: #1c1918;
		--color-main-text: #eeeeee;
		--color-text-maxcontrast: #a9a9a9;
		--color-border: #3d3533;
		--color-background-hover: #2c2624;
	}
}
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font-face); font-size: 15px; color: var(--pdfo-host-text); background: var(--pdfo-host-bg); }
[hidden] { display: none !important; }

/* ---------------- Kopfzeile */
#pdfo-host-header {
	position: fixed; top: 0; left: 0; right: 0; height: var(--header-height); z-index: 2000;
	display: flex; align-items: center; gap: 8px; padding: 0 10px;
	background: linear-gradient(90deg, var(--pdfo-host-accent-dark), var(--pdfo-host-accent)); color: #fff;
	box-sizing: border-box;
}
.pdfo-host-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; padding: 4px 8px; border-radius: 6px; }
.pdfo-host-brand img { filter: brightness(0) invert(1); }
.pdfo-host-brand:hover, .pdfo-host-brand:focus-visible { background: rgba(255,255,255,.14); outline: none; }
.pdfo-host-spacer { flex: 1; }
.pdfo-host-actions { display: flex; align-items: center; gap: 4px; position: relative; }
.pdfo-host-iconbtn, .pdfo-host-user {
	display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px; border: 0; border-radius: 18px;
	background: transparent; color: #fff; cursor: pointer; font: inherit; position: relative;
}
.pdfo-host-iconbtn:hover, .pdfo-host-user:hover, .pdfo-host-iconbtn:focus-visible, .pdfo-host-user:focus-visible { background: rgba(255,255,255,.16); outline: none; }
.pdfo-host-avatar { border-radius: 50%; background: rgba(255,255,255,.2); }
.pdfo-host-uname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfo-host-badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; border-radius: 8px; background: #ffd34d; color: #3a2a00; font-size: 11px; line-height: 16px; text-align: center; padding: 0 3px; }
.pdfo-host-menu {
	position: absolute; right: 0; top: 42px; min-width: 230px; padding: 6px; z-index: 2100;
	background: var(--pdfo-host-card); color: var(--pdfo-host-text); border: 1px solid var(--pdfo-host-border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18);
}
.pdfo-host-menu a, .pdfo-host-menu button {
	display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 6px; background: none;
	color: inherit; font: inherit; text-decoration: none; cursor: pointer; box-sizing: border-box;
}
.pdfo-host-menu a:hover, .pdfo-host-menu button:hover { background: var(--pdfo-host-accent-soft); }
.pdfo-host-menu form { margin: 0; border-top: 1px solid var(--pdfo-host-border); margin-top: 4px; padding-top: 4px; }
.pdfo-host-notifs {
	position: fixed; top: calc(var(--header-height) + 4px); right: 10px; width: min(380px, calc(100vw - 20px)); max-height: 70vh; overflow: auto; z-index: 2100;
	background: var(--pdfo-host-card); border: 1px solid var(--pdfo-host-border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 8px 12px;
}
.pdfo-host-notifs-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 8px; border-bottom: 1px solid var(--pdfo-host-border); }
.pdfo-host-notif { padding: 10px 0; border-bottom: 1px solid var(--pdfo-host-border); }
.pdfo-host-notif:last-child { border-bottom: 0; }
.pdfo-host-notif-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; }

/* ---------------- Inhalt unter der Kopfzeile (wie #content in Nextcloud) */
#content { position: fixed; top: var(--header-height); left: 0; right: 0; bottom: 0; overflow: hidden; background: var(--color-main-background); }
#content.pdfo-host-public { top: 0; }
body.pdfo-host-mode-user #content:has(.pdfo-host-page) { overflow: auto; }

/* ---------------- Gastseiten (Anmelden, Passwort für Link, Fehler) */
.pdfo-host-guest { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; box-sizing: border-box;
	background: radial-gradient(circle at 20% 10%, #b4584a 0, transparent 45%), linear-gradient(160deg, var(--pdfo-host-accent-dark), #3c1712); }
.pdfo-host-guest-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 24px; font-weight: 600; margin-bottom: 18px; }
.pdfo-host-guest-logo img { filter: brightness(0) invert(1); }
.pdfo-host-card { width: min(420px, 100%); box-sizing: border-box; background: var(--pdfo-host-card); color: var(--pdfo-host-text); border-radius: 14px; padding: 26px 26px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.pdfo-host-card h1 { margin: 0 0 14px; font-size: 22px; }
.pdfo-host-card label, .pdfo-host-section label { display: block; margin: 12px 0; font-size: 14px; color: var(--pdfo-host-muted); }
.pdfo-host-card input, .pdfo-host-section input[type=text], .pdfo-host-section input[type=email], .pdfo-host-section input[type=password], .pdfo-host-section input[type=number], .pdfo-host-section input[type=url], .pdfo-host-section select, .pdfo-host-section textarea {
	display: block; width: 100%; box-sizing: border-box; margin-top: 5px; padding: 9px 11px; font: inherit; font-size: 15px;
	color: var(--pdfo-host-text); background: var(--pdfo-host-card); border: 1px solid var(--pdfo-host-border); border-radius: 8px;
}
.pdfo-host-card input:focus, .pdfo-host-section input:focus, .pdfo-host-section select:focus { outline: 2px solid var(--pdfo-host-accent); outline-offset: 0; border-color: transparent; }
.pdfo-host-primary, .pdfo-host-card button, .pdfo-host-section button, .pdfo-host-fp button {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; font: inherit; font-weight: 600;
	border-radius: 8px; border: 1px solid var(--pdfo-host-border); background: var(--pdfo-host-card); color: var(--pdfo-host-text); cursor: pointer;
}
.pdfo-host-card button.pdfo-host-primary, .pdfo-host-primary { background: var(--pdfo-host-accent); border-color: var(--pdfo-host-accent); color: #fff; }
.pdfo-host-card button.pdfo-host-primary { width: 100%; margin-top: 8px; }
.pdfo-host-primary:hover { background: var(--pdfo-host-accent-dark); }
.pdfo-host-btnlink { text-decoration: none; display: inline-flex; min-height: 32px; padding: 0 12px; border-radius: 8px; }
.pdfo-host-link { background: none !important; border: 0 !important; min-height: 0 !important; padding: 0 !important; color: var(--pdfo-host-accent) !important; cursor: pointer; font: inherit; font-weight: normal !important; text-decoration: underline; }
.pdfo-host-hint { color: var(--pdfo-host-muted); font-size: 13.5px; }
.pdfo-host-muted { color: var(--pdfo-host-muted); }
.pdfo-host-error { color: var(--color-error); background: color-mix(in srgb, var(--color-error) 10%, transparent); border-radius: 8px; padding: 9px 12px; }
.pdfo-host-ok { color: var(--color-success); background: color-mix(in srgb, var(--color-success) 10%, transparent); border-radius: 8px; padding: 9px 12px; }

/* ---------------- Hinweise (OCP.Toast) */
#pdfo-host-toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.pdfo-host-toast { pointer-events: auto; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 10px; background: #2c2523; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: pre-line; cursor: pointer; transition: opacity .25s, transform .25s; font-size: 14px; }
.pdfo-host-toast.out { opacity: 0; transform: translateY(8px); }
.pdfo-host-toast-success { background: #24652f; }
.pdfo-host-toast-error { background: #9f2219; }
.pdfo-host-toast-warning { background: #8a5200; }

/* ---------------- Dateiauswahl */
.pdfo-host-overlay { position: fixed; inset: 0; background: rgba(20,12,10,.45); z-index: 25000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pdfo-host-fp { width: min(640px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--pdfo-host-card); color: var(--pdfo-host-text); border-radius: 14px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); box-sizing: border-box; }
.pdfo-host-fp h2 { margin: 0 0 10px; font-size: 18px; }
.pdfo-host-fp-crumbs { font-size: 14px; margin-bottom: 8px; color: var(--pdfo-host-muted); }
.pdfo-host-fp-list { flex: 1; min-height: 220px; overflow: auto; border: 1px solid var(--pdfo-host-border); border-radius: 10px; padding: 4px; }
.pdfo-host-fp-row { display: flex !important; justify-content: flex-start !important; align-items: center; gap: 10px; width: 100%; min-height: 36px !important; border: 0 !important; background: none !important; font-weight: normal !important; padding: 0 10px !important; border-radius: 8px !important; text-align: left; }
.pdfo-host-fp-row:hover:not(:disabled) { background: var(--pdfo-host-accent-soft) !important; }
.pdfo-host-fp-row[aria-selected="true"] { background: var(--pdfo-host-accent) !important; color: #fff !important; }
.pdfo-host-fp-row:disabled { opacity: .45; cursor: default; }
.pdfo-host-fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdfo-host-fp-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (max-width: 600px) {
	.pdfo-host-uname { display: none; }
}
