/* ============================================================
   FFN Portal – Stylesheet
   ============================================================ */

:root {
	--ffn-red:    #9c0f15;
	--ffn-dark:   #1f2937;
	--ffn-muted:  #6b7280;
	--ffn-border: #e5e7eb;
	--ffn-bg:     #f3f4f6;
	--sidebar-w:  240px;
	--header-h:   56px;
	--radius:     10px;
	--muted:      #6b7280;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
	font-family: 'Segoe UI', Arial, sans-serif;
	font-size: 14px;
	color: var(--ffn-dark);
	background: var(--ffn-bg);
}

a { color: var(--ffn-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Auth-Layout ──────────────────────────────────────────── */
.portal-guest { background: var(--ffn-bg); }

.portal-auth-wrap {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.portal-auth-card {
	background: #fff;
	border-radius: var(--radius);
	box-shadow: 0 4px 24px rgba(0,0,0,.08);
	padding: 40px;
	width: 100%;
	max-width: 420px;
}

.portal-auth-logo {
	display: block;
	height: 64px;
	margin: 0 auto 16px;
}

.portal-auth-card h1 {
	text-align: center;
	font-size: 1.4rem;
	color: var(--ffn-red);
	margin-bottom: 4px;
}

.portal-auth-card h2 {
	text-align: center;
	font-size: 1rem;
	font-weight: 400;
	color: var(--ffn-muted);
	margin-bottom: 24px;
}

.portal-auth-links {
	margin-top: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	text-align: center;
	font-size: .85rem;
}

/* ── App-Layout ───────────────────────────────────────────── */
.portal-app {
	display: flex;
	min-height: 100vh;
}

/* Sidebar */
.portal-sidebar {
	width: var(--sidebar-w);
	background: var(--ffn-dark);
	color: #fff;
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	position: fixed;
	top: 0; left: 0; bottom: 0;
	z-index: 100;
	overflow-y: auto;
}

.portal-sidebar__logo {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	border-bottom: 1px solid rgba(255,255,255,.1);
}

.portal-sidebar__logo img { height: 36px; }
.portal-sidebar__logo span { font-size: 1rem; font-weight: 700; }

.portal-nav { flex: 1; padding: 12px 0; }

.portal-nav__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	color: rgba(255,255,255,.75);
	font-size: .9rem;
	transition: background 120ms, color 120ms;
	border-radius: 0;
}
.portal-nav__item svg { width: 18px; height: 18px; flex-shrink: 0; }
.portal-nav__item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.portal-nav__item.is-active { background: var(--ffn-red); color: #fff; }

.portal-nav__sep { height: 1px; background: rgba(255,255,255,.1); margin: 8px 16px; }

.portal-sidebar__user {
	padding: 16px;
	border-top: 1px solid rgba(255,255,255,.1);
	font-size: .82rem;
}
.portal-sidebar__user-name { font-weight: 700; color: #fff; }
.portal-sidebar__user-email { color: rgba(255,255,255,.55); margin-top: 2px; word-break: break-all; }

/* Main */
.portal-main {
	margin-left: var(--sidebar-w);
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.portal-header {
	height: var(--header-h);
	background: #fff;
	border-bottom: 1px solid var(--ffn-border);
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 24px;
	position: sticky;
	top: 0;
	z-index: 50;
}

.portal-header__title { font-size: 1.1rem; font-weight: 700; }
.portal-header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.portal-sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

.portal-content {
	padding: 24px;
	flex: 1;
}

/* Karten-Modus: kein Padding, Inhalt füllt verfügbare Höhe */
.portal-map-page .portal-content {
	padding: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: calc(100vh - var(--header-h));
}

/* ── Formular-Felder ──────────────────────────────────────── */
.portal-field { margin-bottom: 16px; }
.portal-field label {
	display: block;
	font-size: .8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ffn-muted);
	margin-bottom: 6px;
}
.portal-field input,
.portal-field select {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--ffn-border);
	border-radius: 8px;
	font-family: inherit;
	font-size: .95rem;
	background: #fff;
	transition: border-color 120ms;
}
.portal-field input:focus,
.portal-field select:focus {
	outline: none;
	border-color: var(--ffn-red);
}

/* ── Buttons ──────────────────────────────────────────────── */
.portal-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border-radius: 8px;
	border: 1.5px solid transparent;
	font-family: inherit;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 120ms, color 120ms, border-color 120ms;
	text-decoration: none;
}
.portal-btn--primary  { background: var(--ffn-red); color: #fff; }
.portal-btn--primary:hover { background: #7a0b10; text-decoration: none; color: #fff; }
.portal-btn--secondary { background: var(--ffn-dark); color: #fff; }
.portal-btn--secondary:hover { background: #374151; text-decoration: none; color: #fff; }
.portal-btn--ghost { background: #f3f4f6; color: var(--ffn-dark); border-color: var(--ffn-border); }
.portal-btn--ghost:hover { background: var(--ffn-border); text-decoration: none; }
.portal-btn--danger { background: #7f1d1d; color: #fff; }
.portal-btn--full { width: 100%; justify-content: center; }
.portal-btn--sm { padding: 5px 10px; font-size: .8rem; }

/* ── Alerts ───────────────────────────────────────────────── */
.portal-alert {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: .9rem;
	font-weight: 500;
}
.portal-alert--error   { background: #fef2f2; color: #7f1d1d; border: 1px solid #fca5a5; }
.portal-alert--success { background: #ecfdf5; color: #065f46; border: 1px solid #6ee7b7; }
.portal-alert--info    { background: #eff6ff; color: #1e40af; border: 1px solid #93c5fd; }

/* ── Badges ───────────────────────────────────────────────── */
.portal-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: .75rem;
	font-weight: 600;
}
.portal-badge--green { background: #d1fae5; color: #065f46; }
.portal-badge--red   { background: #fee2e2; color: #7f1d1d; }
.portal-badge--blue  { background: #dbeafe; color: #1e40af; }
.portal-badge--gray  { background: #f3f4f6; color: #374151; }

/* ── Tabellen ─────────────────────────────────────────────── */
.portal-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.portal-table th {
	text-align: left;
	padding: 10px 14px;
	background: #f9fafb;
	font-size: .75rem;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--ffn-muted);
	border-bottom: 1.5px solid var(--ffn-border);
}
.portal-table td {
	padding: 10px 14px;
	border-bottom: 1px solid #f3f4f6;
	vertical-align: top;
}
.portal-table tr:last-child td { border-bottom: none; }
.portal-table tr:hover td { background: #fafafa; }
.portal-table__row--inactive td { opacity: .55; }

/* ── Dashboard ────────────────────────────────────────────── */
.portal-welcome { margin-bottom: 24px; font-size: 1rem; color: var(--ffn-muted); }
.portal-welcome strong { color: var(--ffn-dark); }

.portal-module-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}

.portal-module-card {
	background: #fff;
	border: 1.5px solid var(--ffn-border);
	border-radius: var(--radius);
	padding: 24px 16px;
	text-align: center;
	color: var(--ffn-dark);
	font-weight: 700;
	font-size: 1rem;
	transition: border-color 120ms, box-shadow 120ms;
	text-decoration: none;
}
.portal-module-card:hover {
	border-color: var(--ffn-red);
	box-shadow: 0 4px 12px rgba(156,15,21,.1);
	text-decoration: none;
}
.portal-module-card--admin { border-color: var(--ffn-dark); }
.portal-module-card__title { margin-top: 12px; }

/* ── Admin ────────────────────────────────────────────────── */
.portal-admin h2 { margin-bottom: 16px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
	.portal-sidebar {
		transform: translateX(-100%);
		transition: transform 200ms;
	}
	body.sidebar-open .portal-sidebar { transform: translateX(0); }
	.portal-main { margin-left: 0; }
	.portal-sidebar-toggle { display: block; }
	.portal-content { padding: 16px; }
}

/* ── Dashboard Links ──────────────────────────────────────────── */
.portal-links {
	margin-top: 32px;
}

.portal-links__title {
	font-size: .78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: var(--muted);
	margin: 0 0 12px;
}

.portal-links__grid {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.portal-link-card {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1.5px solid var(--ffn-border);
	border-radius: var(--radius);
	padding: 12px 16px;
	text-decoration: none;
	color: var(--ffn-dark);
	transition: border-color 120ms, box-shadow 120ms;
}

.portal-link-card:hover {
	border-color: var(--ffn-red);
	box-shadow: 0 2px 8px rgba(156,15,21,.08);
	text-decoration: none;
}

.portal-link-card__icon {
	font-size: 1.4rem;
	flex-shrink: 0;
	width: 32px;
	text-align: center;
}

.portal-link-card__body { flex: 1; min-width: 0; }

.portal-link-card__title {
	font-weight: 600;
	font-size: .95rem;
}

.portal-link-card__desc {
	font-size: .82rem;
	color: var(--muted);
	margin-top: 2px;
}

.portal-link-card__arrow {
	color: var(--ffn-red);
	font-size: 1rem;
	flex-shrink: 0;
	transition: transform 120ms;
}

.portal-link-card:hover .portal-link-card__arrow {
	transform: translateX(3px);
}