/* 
 * Kommunale Exzellenz - Shared Brand Styles
 * For all products and sites within the Kommunale Exzellenz Suite
 */

/* @font-face declarations relocated to public/css/fonts/inter.css on May 8, 2026 */

/* CSS Variables - Layout-specific */
:root {
    /* Layout Variables */
    --header-height: auto;

    /* Spacing — rem so spacing scales with accessibility font-size preference */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius: defined in utilities.css (px — radii scale with element size, not font-size).
       Shape presets (sharp/soft/rounded) live in theme.css under body[data-ui-shape]. */

    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-gray);
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.card {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.header-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-md) 0;
    text-align: center;
}

.header-section h1 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.header-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-lg);
}

/* Form Components */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

/* Date Input Field */
.edit-form-field {
    margin-bottom: var(--spacing-md);
}

.date-input {
    max-width: 200px;
}

/* User Assignment Field */
.edit-form-user-assignment {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.field-help-text {
    color: var(--text-dark);
    font-size: var(--font-size-sm);
    margin: var(--spacing-xs) 0;
}

.user-assignment-display {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-start; /* Prevent stretching */
}

.user-assignment-btn {
    margin-top: var(--spacing-xs);
    width: auto; /* Don't fill container */
    align-self: flex-start; /* Align to start, not stretch */
}

/* Button Components - REMOVED */
/* Buttons belong in content area CSS files (entwicklung.css, organisation.css, etc.) */
/* NOT in the site template CSS (basis.css) */

/* Alert Components */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-error {
    background-color: #fed7d7;
    border: 1px solid #feb2b2;
    color: var(--color-danger);
}

.alert-success {
    background-color: #c6f6d5;
    border: 1px solid #9ae6b4;
    color: var(--color-success);
}

.alert-info {
    background-color: #bee3f8;
    border: 1px solid #90cdf4;
    color: var(--primary-color);
}

/* Error List Styling */
.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-list li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid #feb2b2;
}

.error-list li:last-child {
    border-bottom: none;
}

/* Navigation */
.nav-brand {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-brand .accent {
    color: var(--accent-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary-color);
}

.text-accent {
    color: var(--accent-color);
}

.text-success {
    color: var(--color-success);
}

.text-muted {
    color: var(--text-gray);
}

/* Font Size Utilities */
.text-xs {
    font-size: var(--font-size-xs);
}
.text-sm {
    font-size: var(--font-size-sm);
}
.text-base {
    font-size: var(--font-size-base);
}
.text-lg {
    font-size: var(--font-size-lg);
}
.text-xl {
    font-size: var(--font-size-xl);
}
.text-2xl {
    font-size: var(--font-size-2xl);
}
.text-3xl {
    font-size: var(--font-size-3xl);
}
.text-4xl {
    font-size: var(--font-size-4xl);
}

/* Grid Utilities */
.grid {
    display: grid;
}

.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.grid-auto-fill {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.gap-sm {
    gap: var(--spacing-sm);
}
.gap-md {
    gap: var(--spacing-md);
}
.gap-lg {
    gap: var(--spacing-lg);
}
.gap-xl {
    gap: var(--spacing-xl);
}

/* Hierarchical Display Components */

/* Margin Utilities */
.m-0 {
    margin: 0;
}
.m-sm {
    margin: var(--spacing-sm);
}
.m-md {
    margin: var(--spacing-md);
}
.m-lg {
    margin: var(--spacing-lg);
}
.m-xl {
    margin: var(--spacing-xl);
}

.mt-0 {
    margin-top: 0;
}
.mt-sm {
    margin-top: var(--spacing-sm);
}
.mt-md {
    margin-top: var(--spacing-md);
}
.mt-lg {
    margin-top: var(--spacing-lg);
}
.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-0 {
    margin-bottom: 0;
}
.mb-sm {
    margin-bottom: var(--spacing-sm);
}
.mb-md {
    margin-bottom: var(--spacing-md);
}
.mb-lg {
    margin-bottom: var(--spacing-lg);
}
.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.ml-0 {
    margin-left: 0;
}
.ml-sm {
    margin-left: var(--spacing-sm);
}
.ml-md {
    margin-left: var(--spacing-md);
}
.ml-lg {
    margin-left: var(--spacing-lg);
}
.ml-xl {
    margin-left: var(--spacing-xl);
}

.mr-0 {
    margin-right: 0;
}
.mr-sm {
    margin-right: var(--spacing-sm);
}
.mr-md {
    margin-right: var(--spacing-md);
}
.mr-lg {
    margin-right: var(--spacing-lg);
}
.mr-xl {
    margin-right: var(--spacing-xl);
}

/* Display Utilities */
.inline {
    display: inline;
}
.inline-block {
    display: inline-block;
}
.block {
    display: block;
}
.hidden {
    display: none;
}

.bg-white {
    background-color: var(--background-white);
}

.bg-light {
    background-color: var(--background-light);
}

.p-sm {
    padding: var(--spacing-sm);
}
.p-md {
    padding: var(--spacing-md);
}
.p-lg {
    padding: var(--spacing-lg);
}
.p-xl {
    padding: var(--spacing-xl);
}

/* Professional German Municipal Aesthetic */
.municipal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-md) 0;
    position: relative;
}

.municipal-header .nav-brand {
    color: white;
}

.municipal-header .nav-brand .accent {
    color: var(--accent-color);
}

.municipal-header h1,
.municipal-header h2,
.municipal-header h3,
.municipal-header h4,
.municipal-header h5,
.municipal-header h6 {
    color: white;
}

.municipal-header p {
    color: white;
    opacity: 0.9;
}

.municipal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.municipal-card {
    background: var(--background-white);
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

/* Responsive Design */

/* ========================================
 * APP LAYOUT SYSTEM - Kommunale Exzellenz Suite
 * ======================================== */

/* Top Header - Fixed 64px height across all breakpoints */
.top-header {
    background: var(--primary-color);
    color: white;
    height: 64px;
    padding: 0 var(--spacing-sm);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none;
    gap: var(--spacing-md);
    width: 100%;
    height: 100%;
}

/* Header Icon Actions */
.header-actions {
    display: none; /* Hidden on mobile by default */
    align-items: center;
    gap: var(--spacing-xs);
}

.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: var(--spacing-sm);
    color: white;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-icon-btn:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.header-icon-btn svg {
    flex-shrink: 0;
}

/* Header notification badge - matches sidebar nav-badge styling */
.header-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--background-white);
    color: var(--primary-color, #003d83);
    border: 1px solid var(--primary-color, #003d83);
    line-height: 1;
}

/* Circle badge for single/double digit numbers */
.header-badge-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0;
}

/* Pill badge for longer text like "3 / 15" — full capsule, matches .status-pill family */
.header-badge-pill {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}

/* --- Notification type indicator (ring-circle + glyph) ----------------------
   Shared by the header + sidebar notification pills. Same visual family as
   .notification-type-icon on the Meldungen cards, shrunk and using currentColor so
   the ring + glyph adapt to both the blue header pill and the orange sidebar
   pill. Replaces the old bare "! n · i m" text glyphs. */
.notif-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.notif-badge-group {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.notif-badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    min-width: 16px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
}

.notif-badge-icon svg {
    width: 11px;
    height: 11px;
}

/* With ring-circle glyphs inside, the pill's own border would read as a
   ring-inside-a-ring — drop it so the circles carry the shape. */
.header-badge:has(.notif-badge),
.nav-badge:has(.notif-badge) {
    border-color: transparent;
}

/* Notification-count poller stale marker (layouts/app.blade.php): after the poller has been
   dark >5min, the EXISTING badge is muted — its live colour (blue header / orange sidebar)
   drains to a neutral light-grey pill with muted-grey content, numbers unchanged. Reads as
   "count may be out of date", not an alert; color-free per the status-is-greyscale canon. The
   explanation rides the bell link's title tooltip — no extra element. Compound selector so it
   beats the base .header-badge/.nav-badge colour regardless of source order. Border left alone:
   the :has(.notif-badge) rule already drops it so the ring-glyphs carry the shape. */
.header-badge.notif-poll-stale,
.nav-badge.notif-poll-stale {
    background: var(--background-light);
    color: var(--color-text-muted);
}

.user-info-header {
    display: none; /* Hidden on mobile */
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.user-info-header .user-name {
    color: var(--accent-color);
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.user-info-header .tenant-name {
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--font-size-xs);
}

/* Menu Toggle Button (was sidebar-toggle) */
.menu-toggle {
    background: none;
    border: none;
    color: white;
    padding: var(--spacing-md);
    min-height: 44px;
    min-width: 44px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.menu-toggle:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

/* Classic Hamburger Menu */
.hamburger {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: var(--background-white);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

/* Perfect X Animation */
.menu-toggle.active .hamburger span:nth-child(1) {
    transform: rotate(45deg);
    position: absolute;
    top: 50%;
    margin-top: -1px;
}

.menu-toggle.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger span:nth-child(3) {
    transform: rotate(-45deg);
    position: absolute;
    top: 50%;
    margin-top: -1px;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 0;
}

.brand {
    font-weight: 700;
    font-size: var(--font-size-sm);
    letter-spacing: 0.5px;
    color: var(--accent-color);
    text-decoration: none;
}

.brand:hover {
    color: var(--accent-color);
    opacity: 0.9;
}

.tenant-separator {
    margin: 0 var(--spacing-xs);
    opacity: 0.6;
    font-weight: 400;
    color: var(--accent-color);
}

.tenant-name {
    font-weight: 400;
    font-size: var(--font-size-xs);
    opacity: 0.9;
    color: var(--accent-color);
    text-decoration: none;
}

.tenant-name:hover {
    opacity: 1;
    text-decoration: underline;
}

.page-title {
    font-weight: 500;
    font-size: var(--font-size-base);
    color: var(--accent-color);
}

.user-actions {
    display: flex;
    align-items: center;
}

/* User Menu Dropdown */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s;
    width: 32px;
    height: 32px;
}

.user-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--background-white);
    color: var(--text-dark);
    min-width: 220px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-gray);
    z-index: 1001;
}

.dropdown-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-gray);
    background: var(--background-light);
}

.user-info {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.tenant-info {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-gray);
    margin: var(--spacing-xs) 0;
}

.user-dropdown.hidden {
    display: none;
}

.dropdown-item {
    display: block;
    padding: var(--spacing-md);
    text-decoration: none;
    color: var(--text-dark);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background: var(--background-light);
}

.dropdown-form {
    margin: 0;
}

/* Mobile Menu Toggle - Removed (mobile-only layout) */

/* CSS Grid App Layout - Mobile First (0-599px) */
.app-layout {
    display: grid;
    grid-template-areas:
        'header'
        'main'
        'footer';
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
}

/* When hamburger is clicked, show sidebar only */
.app-layout.menu-open {
    grid-template-areas:
        'header'
        'sidebar'
        'main'
        'footer';
    grid-template-rows: auto auto 1fr auto;
}

/* Profile section removed - merged into sidebar */

.profile-section.open {
    display: block; /* Show when menu clicked */
}

/* User Display Section - Non-clickable info display */
.profile-section .nav-user-info .nav-item.user-display {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--spacing-sm);
    background: none;
    cursor: default;
    margin-bottom: 0;
}

.profile-section .nav-user-info .nav-item.user-display:hover {
    background: none; /* No hover effect for info display */
}

.profile-section .nav-user-info .user-name {
    color: var(--primary-color);
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.profile-section .nav-user-info .tenant-name {
    color: var(--text-gray);
    font-size: var(--font-size-sm);
}

/* Logout button styling to match nav-item */
.profile-section .logout-form {
    margin: 0;
    width: 100%;
}

.profile-section .logout-btn {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-align: left;
}

/* Sidebar - Simple Grid Item */
.sidebar {
    display: none; /* Hidden by default */
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
        'dashboard'
        'products'
        'profile'
        'spacer';
    background: var(--background-white);
    border-right: 1px solid var(--border-gray);
    grid-area: sidebar;
    overflow-y: auto;
}

.sidebar.open {
    display: grid; /* Show as grid when hamburger clicked */
}

/* Sidebar Overlay - Not needed with grid approach */

.nav-section {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg) 0;
}

/* Grid area assignments for each section */
.nav-dashboard {
    grid-area: dashboard;
}

.nav-products {
    grid-area: products;
}

.nav-profile {
    grid-area: profile;
}

/* Grid gap handles spacing, no margin needed */

.nav-section + .nav-section {
    position: relative;
}

.nav-section + .nav-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: var(--spacing-lg);
    right: var(--spacing-lg);
    height: 1px;
    background: var(--border-gray);
}

/* Navigation Items */
.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    min-height: 44px;
    width: 100%;
    color: var(--text-dark);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

/* Button-specific overrides for toggle buttons */
button.nav-item {
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
}

/* Push the expand chevron to the far right regardless of icon/text flow */
button.nav-item .expand-icon {
    margin-left: auto;
}

/* Keep leading SVG icons on nav-items at fixed size (don't flex-shrink) */
.nav-item > svg {
    flex-shrink: 0;
}

/* Single line product names in navigation - clean and professional */
.sidebar .nav-product .nav-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    white-space: nowrap; /* Prevent any line breaking */
    text-align: left;
}

/* Navigation notification badge — orange to signal action is needed */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--color-action);
    color: white;
    border: 1px solid var(--color-action);
    line-height: 1;
}

/* Circle badge for single/double digit numbers */
.nav-badge-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    padding: 0;
}

/* Pill badge for longer text like "3 / 15" — full capsule, matches .status-pill family */
.nav-badge-pill {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
}

.nav-item:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
    transition: all 0.15s ease-out;
}

.nav-item:focus {
    background: var(--primary-color-tint);
    color: var(--text-dark);
    outline: none;
}

.nav-item.active {
    background: var(--primary-color-tint);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* User & Tenant Info styling */
.nav-item.nav-info {
    cursor: default;
    color: var(--text-gray);
    height: 80px; /* Fixed height for perfect alignment with main content headers */
}

.nav-item.nav-info:hover {
    background: none;
    color: var(--text-gray);
}

/* User & Tenant Info inner structure */
.user-tenant-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.user-tenant-info .user-name {
    font-weight: 500;
    color: var(--text-dark);
}

.user-tenant-info .tenant-name {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

.nav-icon {
    font-size: var(--font-size-lg);
    width: 24px;
    text-align: center;
}

/* Product Navigation — items stack flush, section padding handles breathing room */

button.nav-item:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
}

/* ✅ FIX: Only show tint background on keyboard focus (tab), not on mouse click */
button.nav-item:focus {
    outline: none; /* Remove default outline */
}

button.nav-item:focus-visible {
    background: var(--primary-color-tint);
    color: var(--text-dark);
    outline: 2px solid var(--primary-color); /* Visual indicator for keyboard navigation */
    outline-offset: -2px;
}

button.nav-item .nav-text {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.expand-icon {
    transition: transform 0.2s;
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* Prevent icon from shrinking */
}

.expand-icon.rotated {
    transform: rotate(90deg);
}

/* Submenu */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: var(--spacing-xs);
}

.nav-submenu.expanded {
    max-height: fit-content;
}

/* Thin separator between config-defined submenu groups (see the 'group' key in
   config/navigation.php). Mirrors the .nav-section divider treatment. */
.nav-submenu-divider {
    height: 1px;
    margin: var(--spacing-xs) var(--spacing-lg);
    background: var(--border-gray);
}

.nav-subitem {
    display: block;
    padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm) calc(var(--spacing-lg) + var(--spacing-xl));
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--text-gray);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: var(--font-size-sm);
}

.nav-subitem:not(:last-child) {
    margin-bottom: var(--spacing-xs);
}

.nav-subitem:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
}

.nav-subitem:focus {
    background: var(--primary-color-tint);
    color: var(--text-dark);
    outline: none;
}

.nav-subitem.active {
    background: var(--primary-color-tint);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.external-icon {
    width: 16px;
    height: 16px;
}

/* Main Content */
.main-content {
    background: var(--background-light);
    margin: var(--spacing-sm);
    grid-area: main;
    min-width: 0;
}

/* Footer */
.app-footer {
    background: var(--background-white);
    border-top: 1px solid var(--border-gray);
    padding: var(--spacing-sm) var(--spacing-md);
    grid-area: footer;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.footer-brand {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.footer-version {
    font-size: var(--font-size-xs);
    color: var(--text-gray);
    background: var(--background-light);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
}

.footer-separator {
    color: var(--text-gray);
    margin: 0 var(--spacing-sm);
    font-size: var(--font-size-xs);
}

.footer-right {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-link {
    color: var(--text-gray);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* ============================================
 * BREAKPOINT 1: SMALL TABLET (600px+) 
 * ============================================ */
@media (min-width: 600px) {
    /* Future: Enhanced layout for small tablets */
    /* Currently: Keep mobile layout for all sizes */
}

/* Mobile sticky sidebar when opened */
@media (max-width: 899px) {
    .sidebar {
        position: sticky;
        top: 58px;
        z-index: 99;
    }
}

/* ============================================
 * BREAKPOINT 2: DESKTOP (900px+)
 * ============================================ */
@media (min-width: 900px) {
    /* 2-column grid layout */
    .app-layout {
        display: grid;
        grid-template-columns: 300px 1fr;
        grid-template-areas:
            'header header'
            'sidebar main'
            'footer footer';
        grid-template-rows: auto 1fr auto;
        min-height: 100vh;
    }

    /* Hide hamburger button - everything visible */
    .menu-toggle {
        display: none;
    }

    /* Show header icon actions on desktop */
    .header-actions {
        display: flex;
    }

    /* Show sidebar permanently as grid; sticky to viewport so it stays put while main content scrolls */
    .sidebar {
        display: grid;
        position: sticky;
        top: 64px; /* matches sticky header height */
        align-self: start; /* required so the grid cell doesn't stretch and break sticky */
        height: calc(100vh - 64px);
        /* hide scrollbar visually — internal scroll only kicks in when sidebar content overflows */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .sidebar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* Reset any menu-open specific styling */
    .app-layout.menu-open {
        grid-template-areas:
            'header header'
            'sidebar main'
            'footer footer';
        grid-template-rows: auto 1fr auto;
    }

    /* Footer spans both columns */
    .app-footer {
        grid-area: footer;
    }
}

/* Template Development Page - Only for /basis/template */
.template-dev-content-area {
    background-color: #e3f2fd;
    border: 2px dashed #1976d2;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.template-dev-title {
    color: #1976d2;
    margin-bottom: 1rem;
    font-size: var(--font-size-xl);
    font-weight: 600;
}

.template-dev-text {
    color: #1976d2;
    margin: 0;
    font-size: var(--font-size-base);
}

/* Print Styles — Global base rules moved to print.css */

/* ========================================
   Utility Classes
   ======================================== */

/* Visibility utilities - used across all products */
.hidden {
    display: none;
}

.print-only {
    display: none;
}

.visible {
    display: block;
}

.flex-visible {
    display: flex;
}

/* Empty State Component - used when no data available */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-gray);
}

/* Base Animations - used across products */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ========================================
   Page Tabs - Generic across products
   ======================================== */

/* Wrapper injected by page-tabs-scroll.js — adds chevron buttons when tabs overflow. */
.page-tabs-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
    max-width: 100%;
    min-width: 0;
    gap: 4px;
}

.page-tabs-wrapper > .page-tabs {
    margin-bottom: 0;
    min-width: 0;
}

/* Chevron buttons share the same visual language as inactive .page-tab elements
   so they read as part of the tab row, not as separate controls.
   Dimensions match .page-tab exactly (font-size, font-weight, padding, margin-bottom)
   so chevron and tab heights are identical. */
.page-tabs-scroll-btn {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 10px 12px;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-bottom: -1px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-gray);
    background: var(--background-white);
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
}

.page-tabs-scroll-btn:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
}

.page-tabs-wrapper.has-overflow .page-tabs-scroll-btn {
    display: inline-flex;
}

.page-tabs {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    background: transparent;
    border-bottom: 1px solid var(--border-gray);
    padding: 0;
    margin-bottom: 20px;
    gap: 4px;
    overflow-x: auto;
    scroll-behavior: smooth;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.page-tabs::-webkit-scrollbar {
    display: none;
}

.page-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-bottom: -1px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
    text-decoration: none;
    background: var(--background-white);
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s,
        border-color 0.2s;
    white-space: nowrap;
    flex: 0 0 auto;
}

.page-tab:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
}

.page-tab.active,
.page-tab.active:hover {
    background: var(--primary-color-tint);
    color: var(--text-dark);
    font-weight: 600;
    border-bottom-color: var(--primary-color);
}

.page-tab .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-gray);
    color: var(--text-dark);
    border-radius: var(--radius-lg);
    flex-shrink: 0;
}

.page-tab.active .tab-count {
    background: var(--primary-color);
    color: white;
}

/* Icon inside a page-tab label (Meldungen: "! Aufgaben" / "i Infos").
   Ring-circle around the !/i glyph — joins the shared notification
   "ring-circle + glyph" family (.notif-badge-icon / .notification-type-icon),
   which the tabs previously didn't. 20px matches the .tab-count pill height
   for visual rhythm; transparent interior + currentColor ring so it adapts
   to the tab's rest/hover/active background and color. */
.page-tab .page-tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
}

.page-tab .page-tab-icon svg {
    width: 13px;
    height: 13px;
}

.page-tab--action svg {
    width: 16px;
    height: 16px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

@media (max-width: 599.98px) {
    .page-tabs-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .page-tabs-wrapper.has-overflow .page-tabs-scroll-btn {
        display: none;
    }

    .page-tabs {
        flex-direction: column;
        align-items: stretch;
        overflow-x: visible;
    }

    .page-tab {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.85rem;
        margin-bottom: 0;
        border-bottom: none;
        border-left: 3px solid transparent;
        border-radius: var(--radius-md);
    }

    .page-tab.active,
    .page-tab.active:hover {
        border-left-color: var(--primary-color);
        border-bottom-color: transparent;
    }
}

/* ========================================
   Page Tabs — Folder Variant (.page-tabs--folder)
   Opt-in modifier. Active tab visually merges into the white
   content panel below, like a paper index-card folder.
   Usage: add .page-tabs--folder to the .page-tabs container and
   wrap each tab's content in <div class="page-tab-panel">.
   ======================================== */

.page-tab-panel {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

@media (min-width: 600px) {
    .page-tabs--folder {
        border-bottom: none;
        margin-bottom: 0;
        position: relative;
        padding-bottom: 0;
        z-index: 1;
    }

    /* Folder-variant wrapper: drop bottom margin so the tab row sits flush
       on the panel below, restoring the paper-folder merge. */
    .page-tabs-wrapper:has(.page-tabs--folder) {
        margin-bottom: 0;
    }

    /* Chevron buttons inside a folder-variant wrapper adopt the inactive-tab look:
       grey-light background, 1px grey border all around. margin-bottom: -1px inherits
       from base so the chevron's bottom edge overlaps the same line as the tabs. */
    .page-tabs-wrapper:has(.page-tabs--folder) .page-tabs-scroll-btn {
        background: var(--color-gray-light);
        border: 1px solid var(--border-gray);
    }

    .page-tabs-wrapper:has(.page-tabs--folder) .page-tabs-scroll-btn:hover {
        background: var(--primary-color-tint);
        color: var(--text-dark);
    }

    /* Pull panel up so active tab's white bottom-border tucks under panel's top-border,
       creating the seamless "paper folder" merge. */
    .page-tabs--folder + .page-tab-panel,
    .page-tabs--folder ~ .page-tab-panel,
    .page-tabs-wrapper:has(.page-tabs--folder) + .page-tab-panel,
    .page-tabs-wrapper:has(.page-tabs--folder) ~ .page-tab-panel {
        margin-top: -1px;
    }

    .page-tabs--folder .page-tab {
        background: var(--color-gray-light);
        border: 1px solid var(--border-gray);
        color: var(--text-gray);
        position: relative;
        z-index: 3;
    }

    .page-tabs--folder .page-tab:hover {
        background: var(--primary-color-tint);
        color: var(--text-dark);
    }

    .page-tabs--folder .page-tab.active,
    .page-tabs--folder .page-tab.active:hover {
        background: var(--background-white);
        color: var(--text-dark);
        font-weight: 600;
        border: 1px solid var(--border-gray);
        border-top: 3px solid var(--primary-color);
        border-bottom: 1px solid white;
        z-index: 2;
    }

    .page-tab-panel .meldungen-container {
        background: transparent;
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        margin-bottom: 0;
    }

    /* White cards + stronger border so rows stay distinct against the white panel. */
    .page-tab-panel .notification-card {
        background: var(--background-white);
        border-width: 2px;
    }
}

/* ========================================
   Modal Component - Generic across products
   ======================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background-color: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--background-white);
    margin: 2% auto;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-gray);
    background: var(--background-light);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-gray);
    background: var(--background-light);
}

/* ========================================
   Toggle Switch Component - Used by template-list and generic UI
   ======================================== */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input[type='checkbox'] {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: background-color 0.3s ease;
    border-radius: var(--radius-pill);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: var(--background-white);
    transition: transform 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type='checkbox']:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input[type='checkbox']:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-text {
    font-size: var(--font-size-sm);
    color: var(--text-dark);
    font-weight: 500;
}

.toggle-badge {
    margin-left: var(--spacing-xs);
    color: var(--text-gray);
    font-weight: 400;
    font-size: var(--font-size-sm);
}
/* ==============================================
   API Token Management Styles
   ============================================== */

/* Token List Container */
.api-token-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

/* Token Card (similar to hierarchical item but simpler) */
.api-token-card {
    background: var(--background-white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.2s ease;
}

.api-token-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Token Card Header */
.api-token-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
}

.api-token-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.api-token-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 4px 0 0 0;
}

/* Token String Display */
.api-token-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    margin-top: 12px;
}

.api-token-masked {
    color: #374151;
    flex: 1;
}

.api-token-copy-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.api-token-copy-btn:hover {
    background: #2563eb;
}

/* Token Metadata */
.api-token-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.api-token-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-token-meta-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

.api-token-meta-value {
    font-size: 0.875rem;
    color: #1f2937;
}

/* Status Badge */
.api-status-active {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #def7ec;
    color: #03543f;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 500;
}

.api-status-active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #03543f;
    border-radius: 50%;
}

.api-status-disabled {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fde8e8;
    color: #9b1c1c;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 500;
}

.api-status-disabled::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #9b1c1c;
    border-radius: 50%;
}

.api-status-expired {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fef3c7;
    color: #92400e;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 500;
}

/* Scope Badges */
.api-scope-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 500;
}

/* Token Actions */
.api-token-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* CORS Whitelist Section */
.api-cors-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.api-cors-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.api-cors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.api-cors-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.api-cors-url {
    font-family: 'Courier New', monospace;
    font-size: 0.8125rem;
    color: #374151;
}

.api-cors-remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.6875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.api-cors-remove-btn:hover {
    background: #dc2626;
}

/* CORS Add Form */
.api-cors-add-form {
    display: flex;
    gap: 8px;
}

.api-cors-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.api-cors-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Empty State */
.api-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.api-empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.api-empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.api-empty-state-text {
    font-size: 0.875rem;
    margin-bottom: 24px;
}

/* Statistics Cards */
.api-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.api-stat-card {
    background: var(--background-white);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-lg);
    padding: 16px;
}

.api-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 8px;
}

.api-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.api-stat-change {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Modal Styles - Removed duplicate (primary definition at line 1212) */

.form-group {
    margin-bottom: 20px;
}

.form-group label:not(.btn) {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input[type='text'],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-family: inherit;
}

.form-group input[type='text']:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .api-token-meta {
        grid-template-columns: 1fr;
    }

    .api-stats-grid {
        grid-template-columns: 1fr;
    }

    .api-cors-add-form {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        max-width: none;
    }
}

/* ==============================================
   Statistics Cards - Hierarchical Features
   ============================================== */

/* Statistics Cards */
.statistics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-auto-rows: auto;
    gap: var(--spacing-sm);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-white);
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.stat-content {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-grow: 1;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--text-gray);
    font-weight: 500;
    text-transform: uppercase;
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-dark);
    margin-left: auto;
}

/* =================================================================
   EXPORT MODAL
   ================================================================= */

/* Modal container */
.modal {
    display: flex; /* Changed from 'none' - visibility controlled by modal-hidden class */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

/* Modal hidden state */
.modal-hidden {
    display: none;
}

/* Modal overlay background */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px); /* Safari support */
    backdrop-filter: blur(4px); /* Standardized to 4px */
}

/* Modal dialog wrapper */
.modal-dialog {
    position: relative;
    z-index: 10001;
    width: 90%;
    max-width: 500px;
}

/* Modal content box */
.modal-content {
    position: relative;
    z-index: 1;
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-gray);
}

.modal-header h2 {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
}

/* Modal close button */
.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-gray);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

/* Modal body */
.modal-body {
    padding: var(--spacing-xl);
}

.modal-body p {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-gray);
}

/* Form group */
.form-group {
    margin-bottom: var(--spacing-md);
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type='checkbox'] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label span {
    color: var(--text-dark);
    font-size: var(--font-size-base);
}

/* Export info box */
.export-info {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.export-info p {
    margin: 4px 0;
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

.export-info strong {
    color: var(--text-dark);
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border-top: 1px solid var(--border-gray);
}

/* Responsive: Mobile/Tablet adjustments */
@media (max-width: 600px) {
    .modal-dialog {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-md);
    }
}

/* ===================================================================
   PROFILE PAGE STYLES
   ===================================================================
   Profile page (Startseite) styling - clean, social-media-inspired layout
   Created: October 11, 2025
   =================================================================== */

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: var(--background-white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-gray);
}

.profile-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.profile-title h1 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.75rem;
}

.profile-subtitle {
    margin: 0.25rem 0 0 0;
    color: var(--text-gray);
    font-size: 1rem;
}

/* Page Header Card - matches hierarchical-header-area styling */
.page-header-card {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-gray);
    min-height: 64px;
    display: flex;
    align-items: center;
}

.page-header-card .main-header {
    display: flex;
    align-items: center;
    min-height: 64px;
    width: 100%;
}

.page-header-card .main-header h1 {
    margin: 0;
    flex: 1;
}

.page-header-card-content {
    width: 100%;
}

.page-header-card .page-header-subtitle {
    margin: var(--spacing-xs) 0 0 0;
    color: var(--text-gray);
    font-size: var(--font-size-sm);
    font-weight: 400;
}

/* Page Header Actions - action buttons placed after the page-header-card */
.page-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: calc(-1 * var(--spacing-sm));
    margin-bottom: var(--spacing-md);
}

/* Page Help Icon - Contextual help link in page headers */
/* Note: Now uses hierarchical-action-btn as base, this class only adds right-alignment */
.page-help-icon {
    margin-left: auto;
}

/* Profile Cards */
.profile-card {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-gray);
}

.profile-card h2 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Profile Info Grid */
.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-gray);
    font-weight: 500;
}

.info-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 400;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 600;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Mockup Section & Banner */
.mockup-section {
    background: #fff0f5;
}

.mockup-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--background-white);
    border: 1px dashed #d946a0;
    border-radius: var(--radius-sm);
    color: #9d174d;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.mockup-banner svg {
    flex-shrink: 0;
}

/* Search Info Card */
.search-info-subtitle {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0 0 var(--spacing-md) 0;
}

/* Search results grid — gap from summary */
.search-results-grid {
    margin-top: var(--spacing-md);
}

/* Search info cards (no-search state) — light entity tint, framed border, lift on hover */
.search-info-cards .focus-relationship-card {
    background: color-mix(in srgb, var(--entity-color) 7%, var(--background-white));
    border: 1px solid color-mix(in srgb, var(--entity-color) 28%, transparent);
    border-left: var(--border-accent-width) solid
        color-mix(in srgb, var(--entity-color) var(--border-accent-tint), transparent);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.search-info-cards .focus-relationship-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--entity-color) 45%, transparent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.search-info-cards .relationship-card-content {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
        padding: var(--spacing-md);
    }

    .avatar-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .profile-title h1 {
        font-size: 1.5rem;
    }

    .profile-card {
        padding: var(--spacing-md);
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
   HIERARCHICAL ITEM COMPONENT STYLES
   Issue #11 Fix - Migrated from inline styles
   =================================================================== */

/* Selection indicator - prevents text selection during click interactions */
.selection-indicator {
    user-select: none;
}

/* Actions error message - displayed when actions slot is missing */
.actions-error {
    color: red;
}

/* Expiration warning badge - shown for tokens expiring within 30 days */
.expiration-warning-badge {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

.expiration-warning-badge:hover {
    background-color: #ffecb5;
    border-color: #ffd93d;
}

/* Current user permission badge - shown on permissions the logged-in user has */
.current-user-permission-badge {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

.current-user-permission-badge:hover {
    background-color: #c1e7c9;
    border-color: #a8ddb5;
}

/* Assigned tasks count badge - shown on permissions with task assignments */
.assigned-tasks-badge {
    display: inline-block;
    margin-left: var(--spacing-sm);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #004085;
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

.assigned-tasks-badge:hover {
    background-color: #b3d7ff;
    border-color: #9fcdff;
}

/* Permissions feature - System tasks (grey), assigned tasks (green) */
.content-type-permissions .hierarchical-item:not(.selected) {
    --entity-color: var(--color-system);
    border-left-color: color-mix(in srgb, var(--color-system) var(--border-accent-tint), transparent);
}
.content-type-permissions .hierarchical-item[data-level='2']:not(.selected) {
    --entity-color: var(--color-tasks);
    border-left-color: color-mix(in srgb, var(--color-tasks) var(--border-accent-tint), transparent);
}

/* Password-setup status indicator — color-free (grey + icon), per Functional Color Palette.
   State (pending/expired/inactive) is conveyed by the icon, never by colour. */
.password-setup-status-row {
    margin-top: var(--spacing-xs);
}

.password-setup-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 2px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    background-color: var(--background-light);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

.password-setup-status svg {
    flex-shrink: 0;
}

/* Password-setup link modal — delivery fallback for handing over the setup link. */
.setup-link-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background-color: color-mix(in srgb, var(--text-dark) 45%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.setup-link-modal-overlay[hidden] {
    display: none;
}

.setup-link-modal-overlay:not([hidden]) {
    display: flex;
}

.setup-link-modal {
    width: 100%;
    max-width: 540px;
    padding: var(--spacing-lg);
    background-color: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.setup-link-modal__title {
    margin: 0 0 var(--spacing-sm);
    color: var(--text-dark);
}

.setup-link-modal__hint {
    margin: 0 0 var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.setup-link-modal__expires {
    margin: 0 0 var(--spacing-sm);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.setup-link-modal__url {
    width: 100%;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    font-family: monospace;
    font-size: var(--font-size-sm);
    color: var(--text-dark);
    background-color: var(--background-light);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
}

.setup-link-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

/* ===================================================================
   EMPLOYEE & USER STATUS BADGES
   ===================================================================
   Badge styling for employee management system
   Created: October 26, 2025
   =================================================================== */

/* Employee User Account Badge (Base) */
.employee-user-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

/* Employee User Linked Badge (Success/Green) */
.employee-user-linked {
    color: #03543f;
    background-color: #def7ec;
    border: 1px solid #84e1bc;
}

.employee-user-linked:hover {
    background-color: #c3fae8;
}

/* Employee User Missing Badge (Warning/Orange) */
.employee-user-missing {
    color: #856404;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
}

.employee-user-missing:hover {
    background-color: #ffecb5;
}

/* Employee Position Badge (Info/Blue) */
.employee-position-badge {
    display: inline-block;
    padding: 4px 10px;
    margin-right: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: #1e40af;
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

.employee-position-badge:hover {
    background-color: #bfdbfe;
}

/* Employee Meta Information (Birth date, Phone) */
.employee-meta {
    color: var(--text-gray);
    font-size: var(--font-size-sm);
}

/* User Status Badge (Base) */
.user-status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-xl);
    white-space: nowrap;
    vertical-align: middle;
}

/* User Status Inactive Badge (Warning/Red) */
.user-status-inactive {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.user-status-inactive:hover {
    background-color: #f1b0b7;
}

/* ============================================ */
/* Hierarchical Tree Collapse/Expand System    */
/* ============================================ */

/* Children hidden by collapsed parent (highest priority) */
.hierarchical-item.child-hidden {
    display: none !important; /* Overrides all other visibility states */
}

/* Archived items hidden by toggle */
.hierarchical-item.archive-hidden {
    display: none !important;
}

/* Smooth animations for visibility changes */
.hierarchical-item {
    transition:
        opacity 0.2s ease-out,
        transform 0.2s ease-out;
    opacity: 1;
    transform: translateY(0);
    /* Reload scroll-restore anchor offset — clears the fixed 80px header when
       reloadWith() scrolls back to a just-edited row (notification-system.blade.php). */
    scroll-margin-top: 80px;
}

/* Inactive user item styles (similar to archived items) */
.hierarchical-item.inactive {
    opacity: 0.6;
    background: #fafafa;
    border-left: 4px solid #9ca3af !important; /* Gray border for inactive */
}

.hierarchical-item.inactive .item-name {
    color: var(--text-gray);
}

.hierarchical-item.inactive .item-description {
    color: var(--text-gray);
}

/* User/Employee without linked account - visible warning background */
/* Applies to: Users without employee, Employees without user account */
/* Only Level 1 items, not departments, and not inactive users */
.hierarchical-item.level-1.user-without-employee:not(.inactive) {
    background: #ffeaea; /* Visible light red background */
}

/* ============================================ */
/* User-Employee Link Children (November 2025) */
/* ============================================ */

/* Level 2 employee children under users - green accent */
.hierarchical-item.level-2 .user-employee-link {
    color: var(--color-employees, #4caf50);
    font-weight: 500;
}

/* Employee picker overlay */
.picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.picker-modal {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.picker-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.picker-header-content {
    flex: 1;
}

.picker-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: #333;
}

.picker-subtitle {
    color: #666;
    font-size: 0.875rem;
}

.picker-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.picker-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.picker-content {
    flex: 1;
    overflow: hidden;
}

.picker-content iframe {
    width: 100%;
    height: 500px;
    border: none;
}

.picker-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.picker-footer .btn-secondary {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.picker-footer .btn-secondary:hover {
    background: #eee;
}

.picker-footer .btn-primary {
    padding: 10px 20px;
    background: var(--primary-color, #003d83);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}

.picker-footer .btn-primary:hover {
    background: var(--primary-color-dark, #002a5c);
}

.picker-footer .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Badge Container Spacing */
.hierarchical-item .employee-user-badge,
.hierarchical-item .user-status-badge {
    margin-top: 4px;
}

/* ===================================================================
   LOGIN PAGE STYLES
   ===================================================================
   Marketing link on login page
   Created: October 24, 2025
   =================================================================== */

.login-marketing-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.login-marketing-link:visited {
    color: var(--primary-color);
    text-decoration: none;
}

.login-marketing-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ===================================================================
   EMPLOYEE MANAGEMENT - HIERARCHICAL BORDERS
   ===================================================================
   Color-coded borders for employee management hierarchy
   - Level 0 (Departments): Orange border (matches Position Catalog)
   - Level 1 (Employees): Purple border (main purple - #9C27B0)
   Created: October 25, 2025
   Updated: October 26, 2025 - Employees use main purple
   =================================================================== */

.content-type-employees .hierarchical-item[data-level='0'] {
    --entity-color: var(--color-departments);
    border-left-color: color-mix(in srgb, var(--color-departments) var(--border-accent-tint), transparent);
}

.content-type-employees .hierarchical-item[data-level='1'] {
    --entity-color: var(--color-employees);
    border-left-color: color-mix(in srgb, var(--color-employees) var(--border-accent-tint), transparent);
}

/* Employee Selector Overlay - Orange for departments, Purple for employees */
body[data-content-type='employees'] .hierarchical-item[data-level='0'],
.selector-mode-container[data-content-type='employees'] .hierarchical-item[data-level='0'] {
    --entity-color: var(--color-departments);
    border-left-color: color-mix(in srgb, var(--color-departments) var(--border-accent-tint), transparent) !important;
}

body[data-content-type='employees'] .hierarchical-item[data-level='1'],
.selector-mode-container[data-content-type='employees'] .hierarchical-item[data-level='1'] {
    --entity-color: var(--color-employees);
    border-left-color: color-mix(in srgb, var(--color-employees) var(--border-accent-tint), transparent) !important;
}

/* ===================================================================
   USER MANAGEMENT - HIERARCHICAL BORDERS
   ===================================================================
   Color-coded borders for user management hierarchy

   Normal mode (list view):
   - Level 0 (Departments): Orange border (organizational context)
   - Level 1 (Users): Light Purple border (IT/technical accounts - #BA68C8)

   Selector mode (overlay - flat list):
   - Level 0 (Users): Light Purple border (users displayed as top-level items)

   Created: October 25, 2025
   Updated: October 26, 2025 - Users use light purple variation for IT context
   =================================================================== */

/* Normal mode: Department wrapper */
body:not(.selector-mode) .content-type-users .hierarchical-item[data-level='0'] {
    --entity-color: var(--color-departments);
    border-left-color: color-mix(in srgb, var(--color-departments) var(--border-accent-tint), transparent);
}

/* Normal mode: Users under department */
body:not(.selector-mode) .content-type-users .hierarchical-item[data-level='1'] {
    --entity-color: var(--color-users);
    border-left-color: color-mix(in srgb, var(--color-users) var(--border-accent-tint), transparent);
}

/* Normal mode: Employee children under users - use employee purple */
body:not(.selector-mode) .content-type-users .hierarchical-item[data-level='2'] {
    --entity-color: var(--color-employees);
    border-left-color: color-mix(in srgb, var(--color-employees) var(--border-accent-tint), transparent);
}

/* Selector mode: Users as top-level items (flat list) */
body.selector-mode .content-type-users .hierarchical-item[data-level='0'],
.selector-mode-container[data-content-type='users'] .hierarchical-item[data-level='0'] {
    --entity-color: var(--color-users);
    border-left-color: color-mix(in srgb, var(--color-users) var(--border-accent-tint), transparent);
}

/* ===================================================================
   EMPLOYEE CONTACT SECTION
   ===================================================================
   Shared contact information section for Employee Focus View and Profile
   Created: January 2026
   =================================================================== */

.employee-contact-section {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.employee-contact-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.employee-contact-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.employee-contact-item {
    padding: 14px;
    background: #f9fafb;
    border-radius: var(--radius-lg);
    border-left: var(--border-accent-width) solid #9ca3af;
}

.employee-contact-label {
    display: block; /* keeps the label-above-field gap now that some are real <label> elements (inline by default) */
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.employee-contact-value {
    font-size: 0.9375rem;
    color: #1f2937;
    font-weight: 500;
}

.employee-contact-value a {
    color: var(--primary-color, #003d83);
    text-decoration: none;
}

.employee-contact-value a:hover {
    text-decoration: underline;
}

/* Contact Section Edit Mode */
.employee-contact-item-edit {
    padding: 14px;
    background: #f0f7ff;
    border-radius: var(--radius-lg);
    border-left: var(--border-accent-width) solid #9ca3af;
    margin-bottom: 12px;
}

.employee-contact-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--primary-color, #003d83);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    box-sizing: border-box;
}

/* Print Styles */
@media print {
    .employee-contact-section {
        break-inside: avoid;
    }
}

/* ===================================================================
   EMPLOYEE FOCUS VIEW
   ===================================================================
   Grid layout, identity card, edit mode, GDPR, permissions, training
   Extracted from focus.blade.php inline styles — April 2026
   =================================================================== */

/* --- Focus Grid --- */
.employee-focus-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm, 16px);
    width: 100%;
    box-sizing: border-box;
}

/* --- Identity card (photo + name + actions) --- */
.employee-focus-identity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px;
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.employee-focus-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--entity-color, #9c27b0), #7b1fa2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    margin-bottom: 16px;
}

.employee-focus-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-focus-photo-initials {
    font-size: 52px;
    color: white;
    font-weight: 600;
}

.employee-focus-name {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.employee-focus-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* --- Contact & Personal info cards --- */
.employee-focus-grid > .employee-contact-section {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    margin-bottom: 0;
}

/* --- Training visibility footer & toggle --- */
.training-toggle-link {
    padding: 4px 0 8px;
}

.training-toggle-link a {
    color: var(--primary-color, #2563eb);
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
}

.training-toggle-link a:hover {
    text-decoration: underline;
}

.training-visibility-footer {
    font-size: 0.85rem;
    color: #6b7280;
}

.training-visibility-footer.edit-mode {
    /* width:100% — the shared .relationship-card-footer is display:flex/flex-start,
       which would otherwise shrink-wrap this box; force it to span the card like
       the photo/name/contact edit cards do. */
    width: 100%;
    background: var(--background-white);
    border: 3px solid var(--color-action);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.training-visibility-footer.edit-mode .training-visibility-label {
    color: var(--text-dark);
}

.training-visibility-label {
    font-weight: 500;
    color: #374151;
    margin-right: 4px;
}

.training-visibility-edit .profile-option {
    margin-bottom: 6px;
}

/* --- Audit trail tile (hidden until implemented) --- */
.employee-focus-audit-tile {
    display: none;
}

/* --- Personal Section: edit mode orange --- */
.personal-section.edit-mode .employee-contact-item:not(.gdpr-data-overview) {
    background: var(--background-white);
    border: 3px solid var(--color-action);
    border-left: 3px solid var(--color-action);
    border-radius: var(--radius-lg);
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.personal-section.edit-mode .employee-contact-item:not(.gdpr-data-overview) .employee-contact-label {
    color: var(--text-dark);
}

/* --- GDPR Data Overview --- */
.gdpr-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

.gdpr-toggle-btn:hover {
    opacity: 0.7;
}

.gdpr-chevron {
    transition: transform 0.2s ease;
}

.gdpr-chevron svg {
    width: 18px;
    height: 18px;
    color: #6b7280;
}

.gdpr-chevron-open {
    transform: rotate(180deg);
}

.gdpr-details {
    display: none;
    margin-top: 12px;
}

.gdpr-details.gdpr-expanded {
    display: block;
}

.gdpr-intro {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.gdpr-category {
    margin-bottom: 12px;
}

.gdpr-category-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.gdpr-data-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 0.85rem;
    gap: 8px;
}

.gdpr-data-label {
    color: #6b7280;
    flex-shrink: 0;
}

.gdpr-data-value {
    color: #1f2937;
    text-align: right;
}

.gdpr-managed {
    font-size: 0.75rem;
    color: #9ca3af;
}

.gdpr-export {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.gdpr-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #1f2937;
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
}

.gdpr-export-btn:hover {
    background: #374151;
    color: white;
}

.gdpr-export-btn svg {
    width: 16px;
    height: 16px;
}

.gdpr-export-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 6px;
}

/* --- Edit Mode --- */
.employee-focus-name-edit {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

/* Inline validation error (injected by FormFieldErrors afterend of a name input) — full-width
   below the flex-wrapped name inputs, centered to match the H1 title treatment. */
.employee-focus-name-edit .field-error-message {
    flex-basis: 100%;
    text-align: center;
    margin-top: 2px;
}

.employee-focus-photo-container {
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 4px 16px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: background-color 0.2s ease;
}

.employee-focus-photo-container.edit-mode {
    background: var(--background-white);
    border: 3px solid var(--color-action);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.employee-focus-photo-container.edit-mode .profile-edit-hint,
.employee-focus-photo-container.edit-mode .profile-edit-subtitle {
    color: var(--text-dark);
}

/* The photo card is a centered flex column, so this edit block would otherwise
   shrink-wrap to its widest child and float as a centered island — leaving the
   buttons/hint/options without a shared edge. Full width lines them all up with
   the card's padded border. */
.photo-edit-inline {
    width: 100%;
}

.employee-focus-name-container {
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 4px 16px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.employee-focus-name-container.edit-mode {
    background: var(--background-white);
    border: 3px solid var(--color-action);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.employee-focus-name-container.edit-mode .employee-focus-name-edit {
    margin-bottom: 0;
}

.employee-focus-name-input {
    font-size: 20px;
    font-weight: 600;
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: var(--radius-md);
    box-sizing: border-box;
    max-width: 200px;
    background: var(--background-white);
}

/* HR edit mode: white with orange border on individual edit item cards */
.employee-contact-section.edit-mode .employee-contact-item-edit {
    background: var(--background-white);
    border: 3px solid var(--color-action);
    border-left: 3px solid var(--color-action);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.employee-contact-section.edit-mode .employee-contact-item-edit .employee-contact-label {
    color: var(--text-dark);
}

.employee-contact-section.edit-mode .employee-contact-input {
    border-color: #d1d5db;
    background: var(--background-white);
}

.focus-header-actions-edit {
    display: flex;
    gap: 8px;
}

/* --- Permission Toggle & List --- */
.permission-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.permission-toggle-label {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.permission-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.permission-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.permission-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: var(--radius-pill);
    transition: background-color 0.2s;
}

.permission-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: var(--background-white);
    border-radius: 50%;
    transition: transform 0.2s;
}

.permission-toggle input:checked + .permission-toggle-slider {
    background: var(--color-action);
}

.permission-toggle input:checked + .permission-toggle-slider::before {
    transform: translateX(16px);
}

.relationship-item:has(.task-permissions-list) {
    align-items: flex-start;
}

.relationship-item:has(.task-permissions-list) .relationship-item-actions {
    margin-top: 6px;
}

.task-permissions-list {
    border-top: 1px dashed #e5e7eb;
    margin-top: 8px;
    padding-top: 8px;
}

.task-permissions-category {
    font-size: 0.7rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
    margin-bottom: 4px;
}

.task-permissions-category:first-child {
    margin-top: 0;
}

.task-permissions-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.task-permission-pill {
    display: inline-block;
    font-size: 0.7rem;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    line-height: 1.4;
}

/* --- Breakpoints --- */
@media (min-width: 1200px) {
    .employee-focus-grid {
        grid-template-columns: 1fr 1fr;
    }

    .employee-focus-grid > .employee-contact-section + .employee-contact-section {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1800px) {
    .employee-focus-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .employee-focus-grid > .employee-focus-identity-card,
    .employee-focus-grid > .employee-contact-section,
    .employee-focus-grid > .focus-relationship-card {
        grid-column: span 2;
    }

    .employee-focus-grid > .employee-contact-section + .employee-contact-section {
        grid-column: span 2;
    }

    .employee-focus-grid:not(.has-personal-tile) > .employee-focus-identity-card,
    .employee-focus-grid:not(.has-personal-tile) > .employee-contact-section {
        grid-column: span 3;
    }
}

@media (max-width: 599.98px) {
    .permission-toggle-label {
        display: none;
    }
}

/* --- Print --- */
@media print {
    .employee-focus-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }

    .employee-focus-identity-card {
        border: 1px solid #e5e7eb;
        padding: 10px;
        page-break-inside: avoid;
    }
}

/* ===================================================================
   PROFILE PAGE STYLES
   ===================================================================
   Styling for the user profile page (/basis/profil)
   Created: January 30, 2026
   =================================================================== */

/* Profile Header */
.profile-header {
    background: var(--background-white);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.profile-header-content {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}

/* Profile Photo */
.profile-photo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.profile-photo {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #003d83, #0056b3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-initials {
    font-size: 48px;
    color: white;
    font-weight: 600;
}

/* Profile Info */
.profile-info {
    flex: 1;
}

.profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.profile-name {
    margin: 0;
    color: #1f2937;
    font-size: 1.75rem;
    font-weight: 600;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Profile Position List */
.profile-positions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.profile-position-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.profile-position-title {
    font-weight: 600;
    color: #003d83;
}

.profile-position-grade {
    color: #9ca3af;
    font-size: 13px;
}

.profile-position-separator {
    color: #6b7280;
}

.profile-position-department {
    color: #6b7280;
}

/* Profile Edit Card (white with orange border) */
.profile-edit-card {
    background: var(--background-white);
    border: 3px solid var(--color-action);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.profile-edit-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.profile-edit-section {
    width: 100%;
}

.profile-edit-title {
    font-size: 1.125rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 16px;
}

.profile-edit-subtitle {
    font-size: 0.875rem;
    color: var(--text-dark);
    font-weight: 600;
    margin-bottom: 12px;
}

/* White text variant: subtitle sits on the accent-colored edit-mode background */
.profile-edit-subtitle--on-accent {
    color: var(--color-white);
}

.profile-edit-hint {
    font-size: 0.75rem;
    color: var(--text-gray);
}

/* Profile Buttons — centered row of canonical text-only .btn-primary buttons.
   The buttons themselves carry no scoped styling; they reuse .btn-primary from
   utilities.css (canonical button reuse — no scoped .btn-* lookalikes). */
.profile-button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* Profile Radio/Checkbox Options */
.profile-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.profile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
    background: var(--color-gray-light);
    width: 100%;
    box-sizing: border-box;
}

.profile-option input[type='radio'],
.profile-option input[type='checkbox'] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.profile-option-content {
    flex: 1;
}

.profile-option-label {
    font-size: 0.875rem;
    color: #1f2937;
    font-weight: 500;
}

.profile-option-desc {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}

/* Birthday Input Container */
.profile-birthday-input-wrap {
    background: var(--color-gray-light);
    padding: 15px;
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
}

.profile-birthday-input {
    width: 100%;
    max-width: 200px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    box-sizing: border-box;
}

/* No Employee State */
.profile-no-employee {
    background: var(--background-white);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-no-employee-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.profile-no-employee h2 {
    color: #1f2937;
}

.profile-no-employee p {
    color: #6b7280;
}

/* Mobile Responsive */
@media (max-width: 599.98px) {
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-name-row {
        justify-content: center;
    }

    .profile-actions {
        margin-left: 0;
        margin-top: 12px;
    }

    .profile-positions {
        align-items: center;
    }
}

/* ===================================================================
   HELP PAGE - CONTACT FORM & FAQ STYLES
   ===================================================================
   Styling for contact form and collapsible FAQ section on Hilfe page
   Created: October 29, 2025
   =================================================================== */

/* Help Page Section Anchors - offset for fixed header */
#faq-section,
#dokumentation-section,
#schulungen-section,
#support-section {
    scroll-margin-top: 80px;
}

/* Contact Form */
.support-contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.support-contact-form .form-control {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    transition: border-color 0.2s ease;
}

.support-contact-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.support-contact-form .form-control[readonly] {
    background-color: var(--background-light);
    color: var(--text-gray);
    cursor: not-allowed;
}

.support-contact-form textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.form-info-note {
    padding: var(--spacing-sm);
    background: var(--background-light);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-xs);
}

.form-info-note small {
    color: var(--text-gray);
    font-size: var(--font-size-sm);
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.faq-item {
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    background: var(--background-white);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: var(--shadow-sm);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--background-white);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid transparent;
}

.faq-question:hover {
    background: var(--background-light);
}

.faq-item.active .faq-question {
    border-bottom-color: var(--border-gray);
}

.faq-question span:first-child {
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.faq-toggle {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: var(--spacing-md);
    font-weight: bold;
}

.faq-item.active .faq-toggle {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: var(--spacing-md);
    background: var(--background-light);
    color: var(--text-gray);
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .faq-question {
        padding: var(--spacing-sm);
    }

    .faq-item.active .faq-answer {
        padding: var(--spacing-sm);
    }
}

/* Help Navigation Card */
.help-navigation-card {
    background: var(--background-white);
}

.help-navigation-card h2 {
    color: var(--primary-color);
}

.help-navigation-card .profile-subtitle {
    color: var(--text-gray);
}

/* Standalone interactive-tour CTA tile (above the help menu): explanatory text,
   then the primary "Tour starten" button on its own line at the bottom, left-
   aligned. Interim placement — final home is the Help System rework. */
.help-tour-cta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.help-tour-cta h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.help-tour-cta .btn-primary {
    align-self: flex-start;
    flex: 0 0 auto;
}

.help-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.help-nav-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--background-white);
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
}

.help-nav-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.help-nav-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.help-nav-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.help-nav-content h3 {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-dark);
}

.help-nav-content p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-gray);
    line-height: 1.4;
}

@media (max-width: 600px) {
    .help-nav-grid {
        grid-template-columns: 1fr;
    }

    .help-nav-item {
        padding: var(--spacing-md);
    }

    .help-nav-icon {
        font-size: 2rem;
    }
}

/* Help Resources Section */
.help-resources {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.help-category {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.help-category-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-gray);
}

.help-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.help-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: var(--spacing-md);
}

.help-item:hover {
    background: var(--background-light);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.help-item-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
}

.help-item-title {
    font-weight: 500;
    color: var(--text-dark);
    font-size: var(--font-size-base);
}

.help-item-meta {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

.help-item-description {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
    line-height: 1.5;
    margin-top: var(--spacing-xs);
}

.help-item-action {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--primary-color);
    white-space: nowrap;
    flex-shrink: 0;
}

.help-item:hover .help-item-action {
    color: var(--primary-hover);
}

/* Training Contact Note */
.training-contact-note {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-tasks-100);
}

.training-contact-note p {
    margin: 0;
    color: var(--text-gray);
    line-height: 1.6;
}

/* Training Announcement Banner */
.training-announcement {
    background: linear-gradient(135deg, var(--color-tasks-25) 0%, var(--background-light) 100%);
    border: 1px solid var(--color-tasks-50);
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.training-announcement p {
    margin: 0;
    color: var(--text-dark);
    line-height: 1.6;
}

.training-announcement-sub {
    margin-top: var(--spacing-sm) !important;
    color: var(--text-gray);
    font-size: var(--font-size-sm);
}

/* ============================================
   VIDEO DOCUMENTATION SECTION
   ============================================ */

.documentation-products {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.doc-product-section {
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: var(--spacing-lg);
}

.doc-product-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.doc-product-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.doc-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
}

.doc-feature-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    scroll-margin-top: 80px;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.doc-feature-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.doc-feature-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: var(--font-size-base);
}

.doc-feature-badge {
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.doc-badge-available {
    background: var(--color-tasks-50);
    color: var(--color-tasks-700);
}

.doc-badge-planned {
    background: var(--background-medium);
    color: var(--text-gray);
}

.doc-feature-description {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
    margin: 0;
    line-height: 1.5;
}

.doc-feature-topics {
    margin: 0;
    padding-left: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: 1.6;
}

.doc-feature-topics li {
    margin-bottom: var(--spacing-xs);
}

.doc-feature-topics li:last-child {
    margin-bottom: 0;
}

.doc-video-container {
    margin-top: var(--spacing-sm);
}

.doc-video-container .video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.doc-video-container .video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
}

.doc-feature-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: auto;
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-gray);
}

.doc-action-btn {
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all 0.2s ease;
}

.doc-action-video {
    background: var(--primary-color);
    color: var(--color-white);
}

.doc-action-video:hover {
    background: var(--primary-hover);
}

.doc-action-feature {
    background: var(--background-light);
    color: var(--text-dark);
    border: 1px solid var(--border-gray);
}

.doc-action-feature:hover {
    background: var(--background-medium);
    border-color: var(--border-gray);
}

/* Mobile Responsive for Documentation */
@media (max-width: 600px) {
    .doc-feature-grid {
        grid-template-columns: 1fr;
    }

    .doc-feature-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .doc-feature-actions {
        flex-direction: column;
    }

    .doc-action-btn {
        text-align: center;
    }
}

/* Help Category Description */
.help-category-description {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
    margin: var(--spacing-xs) 0 var(--spacing-sm) 0;
}

/* Planned/Upcoming Items (non-clickable) */
.help-item-planned {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border: 1px dashed var(--border-gray);
    border-radius: var(--radius-md);
    background: var(--background-light);
    cursor: default;
}

.help-item-planned .help-item-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.help-item-planned .help-item-title {
    font-weight: 500;
    color: var(--text-gray);
    font-size: var(--font-size-base);
}

.help-item-planned .help-item-meta,
.help-item-planned .help-item-description {
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

/* Status Badge for Items */
.help-item-badge {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-gray);
    background: var(--background-medium);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* Mobile Responsive for Help Sections */
@media (max-width: 600px) {
    .help-item,
    .help-item-planned {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .help-item-action,
    .help-item-badge {
        align-self: flex-end;
    }

    .help-category-title {
        font-size: var(--font-size-base);
    }

    .training-announcement {
        padding: var(--spacing-md);
    }
}

/* ============================================
   SEARCH FUNCTIONALITY STYLES
   ============================================ */

/* Search Form */
.search-form {
    width: 100%;
}

.search-input-wrapper {
    display: flex;
    gap: var(--spacing-md);
    align-items: stretch;
}

.search-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--background-white);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.search-button {
    padding: 14px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-button:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 61, 131, 0.2);
}

.search-reset-button {
    padding: 14px 24px;
    background: var(--color-gray-light);
    color: var(--text-dark);
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.search-reset-button:hover {
    background: var(--border-gray);
}

/* Search Summary */
.search-summary {
    margin-top: var(--spacing-xl);
    padding: 20px 24px;
    background: var(--background-white);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.search-summary-text {
    font-size: 1rem;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.6;
}

.search-summary-text strong {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
}

.archived-info {
    color: var(--text-gray);
    font-size: 0.875rem;
    margin-left: 8px;
}

/* Search Toggle */
.search-toggle {
    margin-top: var(--spacing-md);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

.toggle-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.toggle-text {
    font-size: var(--font-size-sm);
    color: var(--text-gray);
}

/* Search Results Container */
/* Search result items — relationship-item as links */
a.relationship-item {
    text-decoration: none;
    color: inherit;
}

/* Archived search result */
.search-result-archived {
    opacity: 0.6;
    background: var(--background-light);
}

.search-result-archived:hover {
    opacity: 0.8;
}

.user-employee-name {
    color: var(--text-gray);
    font-weight: 400;
    font-size: 0.9375rem;
}

/* Badge Archived */
.badge-archived {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(156, 163, 175, 0.15);
    color: #6b7280;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Show More Button */
.show-more-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: 12px 20px;
    background: color-mix(in srgb, var(--primary-color) 3%, transparent);
    border: 1px dashed color-mix(in srgb, var(--primary-color) 20%, transparent);
    border-radius: var(--radius-md);
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.show-more-button:hover {
    background: color-mix(in srgb, var(--primary-color) 8%, transparent);
    border-color: var(--primary-color);
    border-style: solid;
    transform: translateY(-1px);
}

/* Chevron flips when expanded; label swaps "more" <-> "less". */
.show-more-button svg {
    transition: transform 0.2s ease;
}

.show-more-button.is-expanded svg {
    transform: rotate(180deg);
}

.show-more-button__less {
    display: none;
}

.show-more-button.is-expanded .show-more-button__more {
    display: none;
}

.show-more-button.is-expanded .show-more-button__less {
    display: inline;
}

/* "Mehr laden": rows past the first 20 stay hidden until the button toggles .show-all.
   Items are <a>, the button is <button>, so nth-of-type counts result rows only. */
.relationship-list.has-hidden:not(.show-all) .relationship-item:nth-of-type(n + 21) {
    display: none;
}

.show-more-hint {
    margin: var(--spacing-xs) 0 0;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* Mobile Responsive for Search */
@media (max-width: 600px) {
    .search-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .search-input {
        padding: 12px 16px;
    }

    .search-button {
        width: 100%;
        padding: 12px 24px;
        justify-content: center;
    }

    .search-reset-button {
        width: 100%;
        padding: 12px 24px;
        justify-content: center;
    }

    .search-summary {
        padding: 16px;
    }

    .search-summary-text strong {
        font-size: 1rem;
    }
}

/* ===================================================================
   FEEDBACK SYSTEM STYLES
   Simple feedback button and modal (November 2025)
   TODO: Replace email workflow with internal feedback system
   =================================================================== */

/* Feedback Button — right-edge vertical tab on desktop, bottom-right FAB on mobile */
.feedback-button {
    position: fixed;
    top: 60%;
    right: 0;
    transform: translateY(-50%);
    background: var(--color-action);
    color: white;
    border: none;
    padding: var(--spacing-md) var(--spacing-sm);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
    z-index: 999;
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-button-label {
    display: block;
}

.feedback-button-icon {
    display: none;
    width: 24px;
    height: 24px;
}

.feedback-button:hover {
    background: var(--color-action);
    transform: translateY(-50%) translateX(-2px);
    box-shadow: 0 14px 22px -4px rgba(0, 0, 0, 0.18);
}

.feedback-button:active {
    transform: translateY(-50%) translateX(0);
}

.feedback-button:focus-visible {
    outline: 2px solid var(--color-action-hover);
    outline-offset: 2px;
}

/* Feedback Modal */
.feedback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.feedback-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px); /* Safari support */
    backdrop-filter: blur(4px);
}

.feedback-modal-content {
    position: relative;
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.feedback-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-gray);
}

.feedback-modal-header h2 {
    margin: 0;
    font-size: var(--font-size-xl);
    color: var(--text-dark);
}

.feedback-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-gray);
    transition: color 0.2s ease;
}

.feedback-modal-close:hover {
    color: var(--text-dark);
}

.feedback-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.feedback-modal-description {
    margin: 0 0 24px 0;
    color: var(--text-gray);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.feedback-modal-body .form-group {
    margin-bottom: 20px;
}

.feedback-modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.feedback-modal-body textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.feedback-modal-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

.form-help-text {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-gray);
}

.feedback-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Success Message */
.feedback-success-message {
    text-align: center;
    padding: 40px 20px;
}

.feedback-success-message svg {
    margin-bottom: 20px;
}

.feedback-success-message h3 {
    margin: 0 0 12px 0;
    font-size: var(--font-size-xl);
    color: #10b981;
}

.feedback-success-message p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.9375rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .feedback-button {
        top: auto;
        bottom: 16px;
        right: 16px;
        transform: none;
        writing-mode: horizontal-tb;
        width: 48px;
        height: 48px;
        padding: 0;
        border-radius: var(--radius-pill);
    }

    .feedback-button-label {
        display: none;
    }

    .feedback-button-icon {
        display: block;
    }

    .feedback-button:hover {
        transform: scale(1.05);
        box-shadow: 0 14px 22px -4px rgba(0, 0, 0, 0.18);
    }

    .feedback-button:active {
        transform: scale(1);
    }

    .feedback-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .feedback-modal-header {
        padding: 20px;
    }

    .feedback-modal-header h2 {
        font-size: var(--font-size-lg);
    }

    .feedback-modal-body {
        padding: 20px;
    }

    .feedback-modal-actions {
        flex-direction: column;
    }

    .feedback-modal-actions .btn-secondary,
    .feedback-modal-actions .btn-primary {
        width: 100%;
    }
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */

/* Modal Overlay */
.notification-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.notification-modal-content {
    position: relative;
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
    z-index: 10001;
}

/* Modal Header */
.notification-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.notification-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

/* Modal Body */
.notification-modal-body {
    padding: 24px;
}

.notification-modal-body p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #4b5563;
    white-space: pre-wrap; /* Preserve line breaks in text */
}

/* Modal Footer */
.notification-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Container */
.notification-toast-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    pointer-events: none; /* Allow clicks through container */
}

/* Toast Base Styles - Banner Style */
.notification-toast {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 64px;
    height: 64px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 4px solid;
    pointer-events: auto; /* Enable clicks on toast itself */

    /* Use transform and transition instead of animation */
    transform: translateY(-100%);
    opacity: 0;
    transition:
        transform 0.3s ease-out,
        opacity 0.3s ease-out;
}

/* Toast visible state */
.notification-toast.notification-toast-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Toast exit animation */
.notification-toast-exiting {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
}

/* Toast Types with Colored Backgrounds */
.notification-toast-success {
    border-bottom-color: #10b981; /* Green */
    background: linear-gradient(to bottom, #d1fae5, #ecfdf5); /* Light green gradient */
}

.notification-toast-error {
    border-bottom-color: #ef4444; /* Red */
    background: linear-gradient(to bottom, #fee2e2, #fef2f2); /* Light red gradient */
}

.notification-toast-warning {
    border-bottom-color: #f59e0b; /* Yellow/Orange */
    background: linear-gradient(to bottom, #fed7aa, #fef3c7); /* Light orange gradient */
}

.notification-toast-info {
    border-bottom-color: #3b82f6; /* Blue */
    background: linear-gradient(to bottom, #dbeafe, #eff6ff); /* Light blue gradient */
}

/* Toast Icon - Hidden */
.notification-toast-icon {
    display: none;
}

/* Toast Message */
.notification-toast-message {
    font-size: 0.9375rem;
    line-height: 1.4;
    color: #1f2937;
    font-weight: 600;
    text-align: center;
}

/* Toast Close Button */
.notification-toast-close {
    position: absolute;
    right: 24px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notification-toast-close:hover {
    color: #1f2937;
    transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

@keyframes notificationPulse {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .notification-toast {
        /* Keep 64px height on mobile too */
        padding: 0 16px;
    }

    .notification-toast-message {
        font-size: 0.875rem;
    }

    .notification-toast-close {
        right: 16px;
        font-size: 1.25rem;
        width: 28px;
        height: 28px;
    }

    .notification-modal-content {
        width: 95%;
        margin: 0 10px;
    }
}

/* =================================================================
   SETTINGS PAGE STYLES (einstellungen)
   User preferences, theme, language, accessibility settings
   ================================================================= */

/* Section description text */
.settings-section-description {
    margin-bottom: 1.5rem;
    color: var(--text-gray);
}

/* Essential-mail clarification under the email-notification opt-outs */
.settings-essential-note {
    margin: var(--spacing-md) 0 0 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Form field groups */
.settings-form-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Form field wrapper */
.settings-field {
    display: flex;
    flex-direction: column;
}

/* Form labels */
.settings-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

/* Form inputs */
.settings-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    box-sizing: border-box;
}

.settings-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

/* Form hints (small text below inputs) */
.settings-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-gray);
}

/* Section titles (h3) */
.settings-section-title {
    margin: 0 0 1rem 0;
    color: var(--text-dark);
}

/* Option list container */
.settings-option-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Checkbox option list (wider gap) */
.settings-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Radio/checkbox option label */
.settings-option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-option-label:hover {
    border-color: var(--primary-color);
}

.settings-option-label.active {
    border: 2px solid var(--primary-color);
}

/* Radio/checkbox input */
.settings-option-input {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Option content wrapper */
.settings-option-content {
    flex: 1;
}

/* Option title */
.settings-option-title {
    font-weight: 500;
    color: var(--text-dark);
}

/* Font size variants for accessibility options */
.settings-option-title--large {
    font-size: 1.125rem;
}

.settings-option-title--extra-large {
    font-size: 1.25rem;
}

/* Option description */
.settings-option-description {
    color: var(--text-gray);
    margin-top: 0.25rem;
}

/* ========================================
   Font Size Stepper Control
   ======================================== */
.font-size-stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    max-width: 280px;
}

.stepper-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    background: #f8f9fa;
    color: var(--text-dark);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.stepper-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.stepper-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.stepper-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #e9ecef;
}

.stepper-level {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    padding: 0.25rem;
}

.stepper-preview {
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
    transition: font-size 0.15s ease;
}

/* Font size preview scaling */
.stepper-preview[data-level='1'] {
    font-size: 0.875rem;
}

.stepper-preview[data-level='2'] {
    font-size: 1rem;
}

.stepper-preview[data-level='3'] {
    font-size: 1.125rem;
}

.stepper-preview[data-level='4'] {
    font-size: 1.25rem;
}

.stepper-preview[data-level='5'] {
    font-size: 1.375rem;
}

.stepper-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: 0.25rem;
    white-space: nowrap;
}

/* Info/warning boxes */
.settings-info-box {
    padding: 0.75rem;
    border-radius: var(--radius-md);
}

.settings-info-box--warning {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    color: #856404;
}

.settings-info-box--info {
    background: #e3f2fd;
    color: #1565c0;
}

/* Featured section with background */
.settings-featured-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
}

/* Section spacing */
.settings-section {
    margin-bottom: 2rem;
}

/* Inline form row (checkbox + label side by side) */
.settings-inline-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.settings-inline-label {
    margin: 0;
    font-weight: 500;
    color: var(--text-dark);
}

/* Buffer/delay input row */
.settings-buffer-row {
    margin-left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.settings-buffer-label {
    margin: 0;
    color: var(--text-gray);
}

.settings-buffer-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-buffer-input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-sm);
}

.settings-buffer-suffix {
    color: var(--text-gray);
}

/* Smart notification info box */
.settings-smart-info {
    margin-left: 2rem;
    padding: 0.75rem;
    background: #e3f2fd;
    border-radius: var(--radius-md);
    color: #1565c0;
}

/* Required badge */
.settings-required-badge {
    color: #dc2626;
}

/* Disabled input styling */
.settings-input-disabled {
    cursor: not-allowed;
}

/* Quiet hours settings */
.settings-quiet-hours {
    margin-left: 2rem;
}

.settings-quiet-hours-description {
    margin: 0 0 1rem 0;
    color: var(--text-gray);
}

.settings-time-inputs {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.settings-time-group {
    display: flex;
    flex-direction: column;
}

.settings-time-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-gray);
}

.settings-time-input {
    padding: 0.5rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-sm);
}

/* Placeholder card styling */
.settings-placeholder-card {
    background: #fff0f3;
}

/* Theme Selection Styles */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.theme-option {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s ease;
    background: var(--background-white);
}

.theme-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 61, 131, 0.1);
}

.theme-option.active {
    border-color: var(--primary-color);
    background: rgba(0, 61, 131, 0.02);
    box-shadow: 0 4px 12px rgba(0, 61, 131, 0.15);
}

.theme-option input[type='radio'] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.theme-colors {
    display: flex;
    gap: 0.375rem;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.theme-description {
    color: var(--text-gray);
    line-height: 1.4;
}

.theme-font {
    color: var(--text-light);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-gray);
}

/* High contrast dark theme preview */
.theme-preview--dark {
    background: #000000;
    color: #ffff00;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.theme-preview--dark .theme-name {
    color: #ffff00;
}

.theme-preview--dark .theme-description {
    color: #ffffff;
}

.theme-preview--dark .theme-font {
    color: #cccccc;
    border-top-color: #ffff00;
}

/* UI Shape preset preview — live demo row showing chip, card, button shapes */
.ui-shape-preview-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.ui-shape-preview-chip,
.ui-shape-preview-card,
.ui-shape-preview-btn {
    background: var(--primary-color-tint);
    border: 1px solid var(--primary-color);
    display: inline-block;
}

.ui-shape-preview-chip {
    width: 32px;
    height: 20px;
}
.ui-shape-preview-card {
    width: 48px;
    height: 32px;
}
.ui-shape-preview-btn {
    width: 64px;
    height: 28px;
    background: var(--primary-color);
}

.ui-shape-preview-chip--soft {
    border-radius: 4px;
}
.ui-shape-preview-card--soft {
    border-radius: 6px;
}
.ui-shape-preview-btn--soft {
    border-radius: 8px;
}
.ui-shape-preview-chip--sharp {
    border-radius: 0;
}
.ui-shape-preview-card--sharp {
    border-radius: 0;
}
.ui-shape-preview-btn--sharp {
    border-radius: 0;
}
.ui-shape-preview-chip--rounded {
    border-radius: 8px;
}
.ui-shape-preview-card--rounded {
    border-radius: 10px;
}
.ui-shape-preview-btn--rounded {
    border-radius: 16px;
}

.save-theme-btn {
    position: relative; /* anchor for the unsaved-change dot (::after) */
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Unsaved-change indicator: a small orange dot on the Save button while a
   live-previewed theme / corner-shape change has not yet been persisted.
   --color-action is sanctioned here — an unsaved edit is an actively-engaged
   state, not a passive status pill. Paired with a title tooltip (set in JS)
   so it is not communicated by colour alone. The white ring lifts it off the
   blue button on both light and dark page backgrounds. */
.save-theme-btn.has-unsaved-changes::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--color-action);
    box-shadow: 0 0 0 2px var(--background-white);
}

.save-theme-btn:hover {
    background: var(--primary-color-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 61, 131, 0.2);
}

.save-theme-btn:active {
    transform: translateY(0);
}

/* Language Selection Styles */
.language-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.language-option {
    position: relative;
    cursor: pointer;
    border: 2px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.2s ease;
    background: var(--background-white);
}

.language-option:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 61, 131, 0.1);
}

.language-option.active {
    border-color: var(--primary-color);
    background: rgba(0, 61, 131, 0.02);
    box-shadow: 0 4px 12px rgba(0, 61, 131, 0.15);
}

.language-option input[type='radio'] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.language-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.language-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.language-flag {
    font-size: 2rem;
    line-height: 1;
}

.language-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
}

.language-description {
    color: var(--text-gray);
    line-height: 1.4;
}

/* ============================================
   Birthday Calendar Styles
   ============================================ */

.birthday-calendar-page {
    /* No max-width or centering - uses full container width like profile page */
}

.birthday-calendar-page .hidden {
    display: none !important;
}

/* Page Header */
.birthday-calendar-page .page-header {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Blur overlay for locked state */
.feature-lock {
    position: relative;
    /* So a short screen does not crush the card against its own toolbar. The
       birthday calendar's locked body is a header and a filter row; the
       colleague quiz's is much taller. */
    min-height: 34rem;
}

.feature-lock .feature-lock__behind {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.feature-lock__overlay {
    position: absolute;
    /* Anchored from the top, not centred. Centring put the card halfway down
       whatever happened to be blurred behind it, so the same lock landed in a
       different place on every screen - high enough to overlap the birthday
       calendar's heading, low and adrift on the colleague quiz. A fixed offset
       puts it in one place regardless of what the feature's body contains. */
    top: 7rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 0 1rem;
}

/* Statistics Cards - Match hierarchical list style */
.birthday-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 20px;
}

.birthday-stat-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--background-white);
    border-radius: var(--radius-lg);
    border: 2px solid var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.birthday-stat-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.birthday-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.birthday-stat-label {
    font-size: 0.75rem;
    color: var(--text-gray);
}

/* Controls */
.birthday-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 20px;
    background: var(--background-white);
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.birthday-search {
    flex: 1;
    min-width: 200px;
}

.birthday-search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.birthday-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.birthday-filter-select {
    padding: 0.625rem 2rem 0.625rem 1rem;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    background: var(--background-white);
    cursor: pointer;
    height: 42px;
    box-sizing: border-box;
}

.birthday-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: var(--radius-md);
}

.birthday-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s ease;
}

.birthday-view-btn:hover {
    background: #e5e7eb;
    color: var(--text-dark);
}

.birthday-view-btn.active {
    background: var(--background-white);
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Today button - matches filter select height */
.birthday-today-btn {
    padding: 0.625rem 1rem;
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
    height: 42px;
    box-sizing: border-box;
}

.birthday-today-btn:hover {
    background: #002a5c;
    border-color: #002a5c;
}

.birthday-today-btn:disabled {
    background: #d1d5db;
    border-color: #d1d5db;
    cursor: not-allowed;
}

/* List View */
.birthday-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.birthday-group {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.birthday-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--text-gray);
    border: none;
    text-align: left;
    cursor: pointer;
}

.birthday-group-chevron {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.birthday-group.collapsed .birthday-group-chevron {
    transform: rotate(-90deg);
}

.birthday-group.collapsed .birthday-cards {
    display: none;
}

/* Search forces all matching groups open so hits are never hidden behind a collapse */
.birthday-list[data-search-active] .birthday-group.collapsed .birthday-cards {
    display: flex;
}

.birthday-list[data-search-active] .birthday-group.collapsed .birthday-group-chevron {
    transform: none;
}

.birthday-group-today .birthday-group-title {
    background: var(--color-action);
}

.birthday-group-week .birthday-group-title {
    background: var(--primary-color);
}

.birthday-group-month .birthday-group-title {
    background: var(--primary-color-tint);
    color: var(--text-dark);
}

.birthday-group-collapsed {
    background: transparent;
    box-shadow: none;
}

/* "Show more" tile — visually a birthday-card row with a centered CTA instead of employee content */
.birthday-show-more-card {
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    color: var(--text-gray);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
}

.birthday-show-more-card:hover {
    color: var(--text-dark);
}

.birthday-cards {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

/* Employee row — mirrors the relationship-item focus-view pattern (entity color = Employees purple) */
.birthday-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--background-white);
    border-radius: var(--radius-sm);
    border: 1px solid #e5e7eb;
    border-left: var(--border-accent-width) solid
        color-mix(in srgb, var(--entity-color) var(--border-accent-tint), transparent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition:
        box-shadow 0.2s ease,
        border-left-color 0.2s ease,
        background-color 0.2s ease;
}

.birthday-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left-color: var(--entity-color);
    background-color: color-mix(in srgb, var(--entity-color) 6%, white);
}

.birthday-card.hidden {
    display: none;
}

.birthday-card-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.birthday-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.birthday-card-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.birthday-card-info {
    flex: 1;
    min-width: 0;
    margin-right: var(--spacing-xs);
}

.birthday-card-name {
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
    line-height: 1.4;
    word-break: break-word;
    margin-bottom: 2px;
}

.birthday-card-name-department {
    font-weight: 400;
    color: var(--text-gray);
    font-size: 0.8125rem;
}

.birthday-card-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.birthday-card-meta-sep {
    opacity: 0.6;
}

.birthday-card-meta-date {
    font-weight: 600;
    color: var(--text-dark);
}

.birthday-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Calendar View */
.birthday-calendar {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.calendar-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-gray);
    background: var(--background-white);
    border-radius: var(--radius-lg);
    cursor: pointer;
    color: var(--text-gray);
    transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.calendar-month-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 180px;
    text-align: center;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    padding: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(140px, 1fr));
    gap: 0.25rem;
    overflow-x: auto;
}

.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: var(--radius-md);
    position: relative;
    /* Allow cell to grow with content */
    height: auto;
}

.calendar-day-empty {
    background: transparent;
}

.calendar-day-weekend {
    background: #f3f4f6;
}

.calendar-day-today {
    background: #eff6ff;
    border: 2px solid var(--primary-color);
}

/* .calendar-day-birthday — the name chips inside the cell carry the "has birthday" signal; no separate cell tint */

.calendar-day-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.calendar-day-weekday {
    display: none; /* Hidden in grid view, shown in vertical */
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
}

.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.calendar-day-today .calendar-day-number {
    color: var(--primary-color);
}

/* Highlight animation for "Today" button */
.calendar-day-highlight {
    animation: highlightPulse 0.5s ease-in-out 3;
}

@keyframes highlightPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0.4);
    }
}

.calendar-day-birthdays {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.calendar-birthday-name {
    font-size: 0.75rem;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.25rem 0.375rem;
    background: color-mix(in srgb, var(--color-employees) 40%, white);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.calendar-birthday-name:hover {
    background: var(--color-employees);
    color: white;
}

/* Year view - all months stacked */
.calendar-grid-year {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Hide empty cells in year view on small screens */
@media (max-width: 1500px) {
    .calendar-grid-year .calendar-day-empty {
        display: none;
    }

    .calendar-grid-year .calendar-grid-inline {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .calendar-grid-year .calendar-header-inline {
        display: none;
    }
}

.calendar-month-section {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendar-month-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.calendar-header-inline,
.calendar-grid-inline {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 0.25rem;
}

.calendar-header-inline {
    margin-bottom: 0.5rem;
}

.calendar-more-link {
    font-size: 0.6875rem;
    color: var(--text-gray);
    padding: 0.125rem 0.25rem;
    cursor: pointer;
}

.calendar-more-link:hover {
    color: var(--primary-color);
}

/* Unlock Prompt */
.feature-lock__card {
    max-width: 480px;
    margin: 3rem auto;
    text-align: center;
    background: var(--background-white);
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.feature-lock__icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.feature-lock__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1rem 0;
}

.feature-lock__message {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.feature-lock__action {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: background 0.2s ease;
}

.feature-lock__action:hover {
    background: #002a5c;
    color: #ffffff;
}

.feature-lock__note {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-gray);
}

.feature-lock__note p {
    font-size: 0.875rem;
    color: var(--text-gray);
    margin: 0;
}

/* Empty State */
.birthday-empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--background-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.birthday-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.birthday-empty h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin: 0 0 0.5rem 0;
}

.birthday-empty p {
    color: var(--text-gray);
    margin: 0;
}

/* Calendar horizontal scroll wrapper */
.birthday-calendar {
    overflow-x: auto;
}

/* Vertical calendar layout for smaller screens */
@media (max-width: 1500px) {
    .birthday-calendar {
        overflow-x: visible;
    }

    /* Reduce nav margin since header is hidden */
    .calendar-nav {
        margin-bottom: 0.5rem;
    }

    /* Hide weekday header row - each day has its own weekday label */
    .calendar-header {
        display: none;
    }

    /* Single column layout */
    .calendar-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Horizontal day layout */
    .calendar-day {
        display: flex;
        align-items: center;
        gap: 1rem;
        min-height: auto;
        padding: 0.75rem 1rem;
    }

    /* Hide empty cells in vertical layout - must come after .calendar-day */
    .calendar-day.calendar-day-empty {
        display: none;
    }

    .calendar-day-header {
        min-width: 80px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    /* Show weekday name in vertical layout with fixed width for alignment */
    .calendar-day-weekday {
        display: inline-block;
        width: 28px;
        text-align: left;
    }

    .calendar-day-number {
        font-size: 1rem;
    }

    .calendar-day-birthdays {
        flex: 1;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .calendar-birthday-name {
        padding: 0.25rem 0.5rem;
    }
}

/* Responsive - mobile */
@media (max-width: 600px) {
    .birthday-stats {
        flex-direction: column;
    }

    .birthday-stat-card {
        width: 100%;
        justify-content: center;
    }

    .birthday-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .birthday-search {
        min-width: auto;
    }

    .birthday-view-toggle {
        align-self: flex-start;
    }

    .birthday-card {
        padding: 8px 10px;
        gap: 8px;
    }
}

/* ==========================================================================
   Meldungen (Notifications) Page Styles
   ========================================================================== */

.meldungen-container {
    background: var(--background-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: var(--spacing-lg);
}

.meldungen-section {
    margin-bottom: var(--spacing-xl);
}

.meldungen-section:last-child {
    margin-bottom: 0;
}

.meldungen-section-title {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

.notification-card {
    position: relative;
    background: #f8f9fa;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all 0.2s ease;
    /* Reload scroll-restore anchor offset (fixed 80px header). */
    scroll-margin-top: 80px;
}

.notification-card:last-child {
    margin-bottom: 0;
}

.notification-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.notification-card.archived {
    opacity: 0.7;
}

.notification-type-icon {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--background-white);
    border: 1.5px solid var(--primary-color);
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.notification-card:hover .notification-type-icon {
    background: var(--color-departments);
    color: white;
    border-color: var(--color-departments);
}

.notification-type-icon svg {
    width: 14px;
    height: 14px;
}

.notification-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.notification-time {
    font-size: 0.875rem;
    color: var(--text-gray);
}

.notification-unread-indicator {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
}

.notification-title {
    margin: 0 0 var(--spacing-sm) 0;
    padding-right: 36px;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 600;
}

.notification-text {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

.notification-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}

.notification-info-text {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
}

.meldungen-empty {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-gray);
}

.meldungen-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.meldungen-empty p {
    margin: 0;
}

/* 2-column layout for notifications on wide screens */
@media (min-width: 1200px) {
    .meldungen-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-lg);
    }

    .meldungen-grid > .meldungen-container {
        margin-bottom: 0;
    }
}

.meldungen-column-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-gray);
    font-style: italic;
}

/* Archive Filters */
.archive-filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

/* Mobile Responsive - Meldungen */
@media (max-width: 600px) {
    .notification-actions {
        flex-direction: column;
    }

    .notification-actions .btn-primary,
    .notification-actions .btn-secondary {
        width: 100%;
    }

    .archive-filters {
        flex-direction: column;
    }

    .archive-filters .btn-primary-active {
        width: 100%;
    }
}

/* ============================================
   SURVEYS - Internal Employee Survey System
   ============================================ */

/* Survey Page Layout */
.surveys-page {
    /* No styling - matches ressourcen-page pattern where wrapper has no CSS */
}

/* ============================================================
   Breadcrumb (canonical) — drives the <x-breadcrumb> component.
   Single source of truth: the old .breadcrumb-nav (surveys) and the
   unused .focus-breadcrumb block (organisation.css) were folded in here.
   ============================================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb-link:hover {
    text-decoration: underline;
}

.breadcrumb-label {
    color: var(--color-text-muted);
}

.breadcrumb-separator {
    color: var(--color-text-muted);
}

.breadcrumb-current {
    color: var(--text-dark);
    font-weight: 600;
}

/* Survey Sections */
.survey-section {
    margin-bottom: var(--spacing-xl);
}

.survey-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 var(--spacing-md) 0;
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--border-gray);
}

/* Survey Card */
.survey-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.survey-card:hover {
    box-shadow: var(--shadow-sm);
}

.survey-card.expanded {
    box-shadow: var(--shadow-md);
}

.survey-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    background: var(--background-white);
    transition: background-color 0.2s ease;
}

.survey-card-header:hover {
    background: var(--bg-hover);
}

.survey-card-main {
    flex: 1;
    min-width: 0;
}

.survey-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.survey-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-gray);
}

.survey-meta > div {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.survey-meta svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.survey-card-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.survey-participation-info {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Survey Card Content (Expanded) */
.survey-card-content {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-gray);
    background: var(--background-light);
}

.survey-details {
    margin-bottom: var(--spacing-md);
}

.survey-description {
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
    line-height: 1.5;
}

.survey-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.survey-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.survey-info-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.survey-info-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

/* Questions Preview */
.survey-questions-preview {
    margin-top: var(--spacing-md);
}

.survey-questions-list {
    list-style: none;
    padding: 0;
    margin: var(--spacing-sm) 0 0 0;
}

.survey-questions-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.survey-questions-list li.more-questions {
    color: var(--text-gray);
    font-style: italic;
}

/* Question Type Badge */
.question-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--background-light);
    color: var(--text-gray);
    border: 1px solid var(--border-gray);
}

.question-type-badge-sm {
    padding: 1px 6px;
    font-size: 0.7rem;
}

/* Survey Card Actions */
.survey-results-hint {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-style: italic;
    margin: 0;
}

.survey-results-preview {
    padding: var(--spacing-md);
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.survey-results-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: var(--spacing-xs);
}

.participation-progress-sm {
    height: 6px;
    margin-bottom: var(--spacing-md);
}

.survey-results-preview .btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.survey-card-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-gray);
    margin-top: var(--spacing-md);
}

/* Survey Form Card */
.survey-form-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.survey-form-card h3 {
    margin: 0 0 var(--spacing-lg) 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group-half {
    flex: 1;
}

.form-hint {
    display: block;
    margin-top: var(--spacing-xs);
    font-size: 0.8rem;
    color: var(--text-gray);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-label input[type='checkbox'] {
    width: 18px;
    height: 18px;
}

/* Questions Section */
.survey-questions-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-gray);
}

.survey-questions-section h4 {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

#questions-container {
    margin-bottom: var(--spacing-md);
}

/* Question Card (Editor) */
.question-card {
    background: var(--background-light);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.question-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.question-options {
    margin-top: var(--spacing-sm);
}

.option-row {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.option-row input {
    flex: 1;
}

.question-rating-config {
    margin-top: var(--spacing-sm);
}

/* Add Question Buttons */
.add-question-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-gray);
}

/* Survey Response Form */
.survey-response-form {
    margin-top: var(--spacing-lg);
}

.survey-question-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.survey-question-card.has-error {
    border-color: var(--color-danger);
}

.survey-question-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.question-number {
    font-weight: 600;
    color: var(--primary-color);
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.survey-question-body {
    margin-left: var(--spacing-lg);
}

.question-options .radio-label,
.question-options-inline .radio-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    cursor: pointer;
}

.question-options-inline {
    display: flex;
    gap: var(--spacing-xl);
}

/* Rating Scale */
.question-rating {
    padding: var(--spacing-md) 0;
}

.rating-scale {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.rating-option:hover {
    background: var(--bg-hover);
}

.rating-option input {
    display: none;
}

.rating-value {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-gray);
    border-radius: 50%;
    font-weight: 600;
    transition: all 0.2s ease;
}

.rating-option input:checked + .rating-value {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.rating-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-align: center;
}

.rating-endpoints {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-gray);
}

/* Free Text */
.question-freetext textarea {
    width: 100%;
    resize: vertical;
}

/* Survey Form Actions */
.survey-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-gray);
}

/* Survey Message Boxes */
.survey-message {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
}

.survey-message svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.survey-message h3 {
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.survey-message p {
    margin: 0;
    color: var(--text-dark);
}

.survey-message-success {
    background: var(--success-bg, #e8f5e9);
    border: 1px solid var(--color-success, #4caf50);
}

.survey-message-success svg {
    color: var(--color-success, #4caf50);
}

.survey-message-info {
    background: var(--info-bg, #e3f2fd);
    border: 1px solid var(--color-info, #2196f3);
}

.survey-message-info svg {
    color: var(--color-info, #2196f3);
}

.survey-message-warning {
    background: var(--warning-bg, #fff3e0);
    border: 1px solid var(--color-warning, #ff9800);
}

.survey-message-warning svg {
    color: var(--color-warning, #ff9800);
}

/* Survey Results */
.survey-results-summary {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.survey-results-card {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
}

.results-stat {
    text-align: center;
}

.results-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.results-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.results-stat-highlight .results-stat-value {
    color: var(--primary-color);
}

/* Participation Progress Bar */
.participation-progress {
    height: 8px;
    background: var(--background-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.participation-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Results Questions */
.survey-results-questions {
    margin-bottom: var(--spacing-xl);
}

.survey-result-card {
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
}

.survey-result-header {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--background-light);
    border-bottom: 1px solid var(--border-gray);
}

.survey-result-body {
    padding: var(--spacing-lg);
}

.survey-result-footer {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--background-light);
    border-top: 1px solid var(--border-gray);
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Result Bars */
.result-bars {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.result-bar-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: var(--spacing-md);
    align-items: center;
}

.result-bar-label {
    font-size: 0.9rem;
    color: var(--text-dark);
}

.rating-label-text {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.result-bar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex: 1;
}

.result-bar {
    height: 24px;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    min-width: 2px;
    transition: width 0.3s ease;
}

.result-bar-yes {
    background: var(--color-success, #4caf50);
}

.result-bar-no {
    background: var(--color-danger);
}

.result-bar-value {
    font-size: 0.85rem;
    color: var(--text-gray);
    white-space: nowrap;
}

/* Rating Results */
.result-rating {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.result-rating-average {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.result-rating-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.result-rating-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Free Text Results */
.result-freetext {
    padding: var(--spacing-sm) 0;
}

.result-responses-count {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: var(--spacing-md);
}

.result-responses-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.result-response-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-dark);
}

.result-response-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.5;
}

.no-responses {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-gray);
    font-style: italic;
}

/* Survey Results Actions */
.survey-results-actions {
    display: flex;
    justify-content: flex-start;
    gap: var(--spacing-md);
}

/* Tab Count Badge */
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: var(--spacing-xs);
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-lg);
}

/* Mobile Responsive - Surveys */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .survey-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .survey-card-right {
        width: 100%;
        justify-content: flex-start;
    }

    .survey-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .survey-info-grid {
        grid-template-columns: 1fr;
    }

    .survey-card-actions {
        flex-wrap: wrap;
    }

    .add-question-buttons {
        flex-direction: column;
    }

    .add-question-buttons .btn {
        width: 100%;
        justify-content: center;
    }

    .form-actions,
    .survey-form-actions {
        flex-direction: column;
    }

    .form-actions .btn,
    .survey-form-actions .btn {
        width: 100%;
    }

    .survey-results-card {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .result-bar-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }

    .rating-scale {
        flex-wrap: wrap;
        justify-content: center;
    }

    .question-options-inline {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* ==========================================
   Logbuch (Audit Trail)
   ========================================== */

.logbook-container {
    background: var(--background-white, #fff);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.logbook-filters form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.logbook-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: flex-end;
}

.logbook-filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 150px;
}

.logbook-filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.logbook-filter-group select,
.logbook-filter-group input {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-gray, #ddd);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--background-white, #fff);
    color: var(--text-dark);
}

.logbook-filter-search {
    flex: 2;
}

.logbook-filter-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: flex-end;
    flex-shrink: 0;
}

.logbook-result-count {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.logbook-table-wrapper {
    overflow-x: auto;
}

.logbook-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.logbook-table thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border-gray, #ddd);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.logbook-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-gray, #eee);
    vertical-align: top;
}

.logbook-table tbody tr:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.02));
}

/* Timestamp: date + time stacked */
.logbook-timestamp {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.logbook-date,
.logbook-time {
    white-space: nowrap;
}

.logbook-time {
    color: var(--color-text-muted, #9ca3af);
}

/* User link */
.logbook-user-link {
    color: var(--primary-color, #4f46e5);
    text-decoration: none;
}

.logbook-user-link:hover {
    text-decoration: underline;
}

/* Event Badges */
.logbook-event-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--background-light, #f3f4f6);
    color: var(--color-text-muted, #6b7280);
}

/* Expandable rows */
.logbook-row-expandable {
    cursor: pointer;
}

.logbook-row-expandable:hover {
    background: var(--bg-hover, rgba(0, 0, 0, 0.03));
}

.logbook-row-expanded {
    background: var(--bg-hover, rgba(0, 0, 0, 0.02));
}

.logbook-expand-hint {
    display: inline-block;
    margin-left: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--primary-color, #4f46e5);
}

.logbook-row-expanded .logbook-expand-hint {
    opacity: 0.5;
}

.logbook-detail-row td {
    padding: 0 0.75rem 0.75rem;
    border-bottom: 1px solid var(--border-gray, #eee);
    background: var(--background-light, #f9fafb);
}

.logbook-detail-row:hover {
    background: none;
}

/* Change Diffs */
.logbook-diff {
    padding: var(--spacing-sm);
    font-size: 0.8rem;
}

.logbook-diff-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    padding: 4px 0;
    border-bottom: 1px solid var(--border-gray, #eee);
    word-break: break-word;
}

.logbook-diff-row:last-child {
    border-bottom: none;
}

.logbook-diff-key {
    font-weight: 600;
    color: var(--color-text-muted);
    min-width: 100px;
    flex-shrink: 0;
}

.logbook-diff-old {
    color: var(--status-red-text, #991b1b);
    text-decoration: line-through;
}

.logbook-diff-arrow {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.logbook-diff-new {
    color: var(--status-green-text, #166534);
}

.logbook-diff-arrays {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    width: 100%;
}

.logbook-diff-list {
    color: var(--text-dark);
}

.logbook-diff-list div,
.logbook-diff-arrays .logbook-diff-old div,
.logbook-diff-arrays .logbook-diff-new div {
    padding: 1px 0;
    font-size: 0.78rem;
}

.logbook-pagination {
    margin-top: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

.logbook-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--color-text-muted);
}

/* Mobile-first: hide Event + Model columns, stack timestamp */
.logbook-col-event,
.logbook-col-model {
    display: none;
}

.logbook-date {
    display: block;
}

.logbook-time {
    display: block;
    font-size: 0.75rem;
}

.logbook-filter-row {
    flex-direction: column;
}

.logbook-filter-group {
    min-width: 100%;
}

.logbook-filter-actions {
    flex-wrap: wrap;
}

/* 600px: filters side by side */
@media (min-width: 600px) {
    .logbook-filter-row {
        flex-direction: row;
    }

    .logbook-filter-group {
        min-width: 150px;
    }
}

/* 900px: show Model column, timestamp inline */
@media (min-width: 900px) {
    .logbook-col-model {
        display: table-cell;
    }

    .logbook-date {
        display: inline;
    }

    .logbook-time {
        display: inline;
        font-size: 0.8rem;
    }
}

/* 1200px: show Event column */
@media (min-width: 1200px) {
    .logbook-col-event {
        display: table-cell;
    }
}

/* ============================================================================
   Edit Locking — presence notices (Phase 2; locked banner re-scoped Phase 3)
   Rendered by basis/hierarchical/scripts/edit-lock.blade.php on opted-in
   surfaces (Dienstanweisungen, later Organisation). The transient owner-side
   notices (idle / changed-while-away) stay neutral white; the locked banner is
   the orange (--color-action) "attention + info" surface with an info icon.
   ============================================================================ */
.edit-lock-notice {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* waiting-user banner can carry 2–3 actions — wrap on narrow screens */
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background-white);
    color: var(--color-text-muted);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.35;
    cursor: default;
}

.edit-lock-notice__text {
    flex: 1 1 12rem; /* keep the message on the first line; actions wrap beneath when tight */
    min-width: 0;
}

.edit-lock-notice__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edit-lock-notice__icon svg {
    display: block;
}

/* On the orange locked banner the info icon is a white-bordered circle filled with the
   same action-orange, holding a white "i" — sized in em so it reads at the message's
   font size, not oversized. */
.edit-lock-notice--locked .edit-lock-notice__icon {
    box-sizing: border-box;
    width: 1.5em;
    height: 1.5em;
    background: var(--color-action);
    border: 1.5px solid var(--color-white);
    border-radius: 50%;
    color: var(--color-white);
}

.edit-lock-notice--locked .edit-lock-notice__icon svg {
    width: 1em;
    height: 1em;
}

/* Locked banner — a compact, left-aligned "alert strip" that sits in the list like a
   directive row, NOT a big centered card. Solid orange (--color-action) fill + white
   text + an info (i) icon = the app's standard "pay attention, here's info" surface
   (same colourway as the Meldungen counter). Headline + detail sit inline on one line;
   the buttons wrap beneath only when the row is too narrow (the base .edit-lock-notice
   is already flex + wrap + align-items:center). (decision: TODO_EDIT_LOCKING.md Phase 3) */
.edit-lock-notice--locked {
    background: var(--color-action);
    color: var(--color-white);
    border: 2px solid var(--color-action);
}

.edit-lock-notice--locked .edit-lock-notice__text {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--spacing-sm);
    flex: 1 1 auto;
    min-width: 0;
}

.edit-lock-notice__headline {
    font-weight: 700;
    color: var(--color-white);
}

.edit-lock-notice__detail {
    color: var(--color-white);
    opacity: 0.9; /* slightly softened under the bold white headline */
    font-size: 0.85rem;
}

.edit-lock-notice__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* Force-unlock (dev only) = a crisp white chip on the orange banner; on hover a faint
   orange tint, never a solid-orange fill (which would merge into the banner). */
.edit-lock-notice--locked .edit-lock-notice__action {
    background: var(--background-white);
    color: var(--color-action);
    border-color: var(--background-white);
}

.edit-lock-notice--locked .edit-lock-notice__action:hover {
    background: color-mix(in srgb, var(--color-action) 12%, var(--background-white));
    color: var(--color-action);
    border-color: var(--background-white);
}

.edit-lock-notice__action {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.edit-lock-notice__action:hover {
    background: color-mix(in srgb, var(--text-dark) 8%, transparent);
}

.edit-lock-notice__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.edit-lock-notice__close:hover {
    background: color-mix(in srgb, var(--color-text-muted) 12%, transparent);
}

.edit-lock-notice__close svg {
    display: block;
    width: 16px;
    height: 16px;
}

/* ============================================================================
   Edit-lock conflict modal — per-field merge (optimistic 409).
   Shown when a save loses a race: the user keeps their unsaved text and chooses,
   per field, which version to keep. Color-free per the Functional Color Palette
   (grey + icon); --color-action used ONLY as an outline/accent on a field where
   BOTH sides changed (a "needs your attention" cue), never as a body fill.
   ============================================================================ */
.edit-lock-conflict-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002; /* above page modals (10000/10001): this is a blocking decision */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: color-mix(in srgb, var(--text-dark) 45%, transparent);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.edit-lock-conflict {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 2 * var(--spacing-lg));
    overflow-y: auto;
    background: var(--background-white);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--text-dark) 25%, transparent);
    padding: var(--spacing-lg);
}

.edit-lock-conflict__header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.edit-lock-conflict__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.edit-lock-conflict__icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.edit-lock-conflict__title {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.edit-lock-conflict__intro {
    margin: 0 0 var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.edit-lock-conflict__fields {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.edit-lock-conflict__field {
    margin: 0;
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
}

.edit-lock-conflict__field--choose {
    border-color: var(--color-action);
}

.edit-lock-conflict__legend {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0 var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
}

.edit-lock-conflict__hint {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--color-action);
}

.edit-lock-conflict__option {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.edit-lock-conflict__option:hover {
    background: var(--primary-color-tint);
}

.edit-lock-conflict__option:has(input:checked) {
    background: var(--primary-color-tint);
    border-color: var(--primary-color);
}

.edit-lock-conflict__option input[type='radio'] {
    margin-top: 3px;
    flex-shrink: 0;
}

.edit-lock-conflict__option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.edit-lock-conflict__option-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.edit-lock-conflict__option-value {
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.edit-lock-conflict__option-value.is-empty {
    font-style: italic;
    color: var(--color-text-muted);
}

.edit-lock-conflict__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.edit-lock-conflict__actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
