/*
 * Ressourcen - Product-specific styling
 * Room management and booking system
 * Builds upon basis.css foundation
 */

/* ============================================
   Page Layouts
   ============================================ */

.ressourcen-page,
.room-bookings-page,
.room-booking-create-page,
.room-booking-show-page {
    /* No styling - matches profile page pattern where wrapper has no CSS */
}

/* ============================================
   Inline Statistics
   ============================================ */

.inline-stats {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 0;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid #E5E7EB;
    font-size: 0.85rem;
    color: #6B7280;
}

.inline-stat {
    font-weight: 500;
}

.inline-stat-sep {
    margin: 0 8px;
    color: #D1D5DB;
}

/* ============================================
   Page Header - Profile Page Style
   ============================================ */

.ressourcen-page-header {
    background: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: none;
}

/* ============================================
   ROOM MANAGEMENT STYLES
   ============================================ */

/* Search Input */
.search-wrapper {
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #1F2937;
    transition: border-color 0.15s, box-shadow 0.15s;
}

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

.search-input::placeholder {
    color: #9CA3AF;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6B7280;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--color-primary, #003D83);
}

/* Rooms List (stacked cards like bookings) */
.rooms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking-card.room-card-inactive {
    background-color: #FEE2E2;
}

.booking-card.room-card-archived {
    opacity: 0.6;
    background-color: #f3f4f6;
}

/* Room Groups */
.room-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--color-primary, #003D83);
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.15s ease;
}

.room-group-header:hover {
    opacity: 0.9;
}

.room-group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
}

.room-group-chevron {
    color: #ffffff;
    font-size: 1rem;
}

.room-group-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-card-description {
    margin: 0 0 8px 0;
    font-size: 0.85rem;
    color: #6B7280;
    line-height: 1.4;
}

/* Equipment Tags */
.room-equipment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.equipment-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6B7280;
}

.service-tag {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}

/* Empty State in Rooms List */
.rooms-list .empty-state {
    border: 2px dashed #E5E7EB;
}

/* Room Inline Form */
.room-form-section {
    margin-bottom: 20px;
    scroll-margin-top: 80px;
}

.room-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.room-form-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    padding-bottom: 0;
    border-bottom: none;
}

/* Equipment Grid in Modal */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.equipment-grid .checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.equipment-grid .checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Form Row for side-by-side fields */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ============================================
   Room Detail Sections (Inline Card View)
   ============================================ */

.room-detail-sections {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-detail-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.room-detail-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary, #003D83);
    padding-bottom: 4px;
    border-bottom: 1px solid #E5E7EB;
}

.room-detail-display {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.room-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #E5E7EB;
    border-left: 3px solid var(--color-primary, #003D83);
    padding: 8px 14px;
    border-radius: 0 4px 4px 0;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.room-detail-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateX(2px);
}

.room-detail-label {
    font-size: 0.8rem;
    color: #6B7280;
    flex-shrink: 0;
}

.room-detail-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    text-align: right;
}

.room-detail-value--muted {
    color: #9CA3AF;
    font-weight: 400;
    font-style: italic;
}

/* Edit mode containers */
.room-detail-edit {
    display: none;
}

/* Edit mode orange highlight */
.room-detail-section.edit-mode .room-detail-section-title {
    color: #EA580C;
    border-bottom-color: #FB923C;
}

.room-detail-section.edit-mode .room-detail-item-edit {
    background: #FFF7ED;
    border-left-color: #F97316;
}

.room-detail-section.edit-mode .room-detail-label {
    color: #9A3412;
}

/* Edit inputs */
.room-edit-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    color: #1F2937;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.room-edit-input:focus {
    outline: none;
    border-color: #F97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.room-edit-input-title {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 8px 12px;
}

.room-edit-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    color: #1F2937;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.room-edit-textarea:focus {
    outline: none;
    border-color: #F97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Orange highlight for name and description inputs in edit/create mode */
.booking-card[data-edit-mode="true"] .room-edit-input-title,
.room-card-create .room-edit-input-title,
.service-card-create .room-edit-input-title,
.equipment-card-create .room-edit-input-title {
    background: #FFF7ED;
    border-color: #F97316;
}

.booking-card[data-edit-mode="true"] .room-edit-textarea,
.room-card-create .room-edit-textarea,
.service-card-create .room-edit-textarea,
.equipment-card-create .room-edit-textarea {
    background: #FFF7ED;
    border-color: #F97316;
}

/* Checkbox grid for equipment/services in edit mode */
.room-edit-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
}

.room-edit-checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #FFF7ED;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #1F2937;
    transition: background 0.15s;
}

.room-edit-checkbox-item:hover {
    background: #FFEDD5;
}

.room-edit-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #F97316;
    cursor: pointer;
}

/* Switch row for toggles in edit mode */
.room-edit-switch-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.room-edit-switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #FFF7ED;
    border-left: 3px solid #F97316;
    border-radius: 0 4px 4px 0;
}

.room-edit-switch-item .switch-text {
    font-size: 0.85rem;
    color: #9A3412;
}

/* Action button containers */
.room-actions-edit,
.service-actions-edit,
.equipment-actions-edit {
    display: none;
}

/* Create card (dashed border) */
.room-card-create {
    border: 2px dashed #F97316;
    background: #FFFBF5;
    scroll-margin-top: 80px;
}

.room-card-create .booking-card-content {
    display: block;
    border-top: 1px solid #FDBA74;
}

.room-card-create-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-card-create-header .room-edit-input-title {
    flex: 1;
}

/* Create cards for services/equipment (dashed border, same as room) */
.service-card-create,
.equipment-card-create {
    border: 2px dashed #F97316;
    background: #FFFBF5;
    scroll-margin-top: 80px;
}

.service-card-create .booking-card-content,
.equipment-card-create .booking-card-content {
    display: block;
    border-top: 1px solid #FDBA74;
}

.service-create-header,
.equipment-create-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-create-header .room-edit-input-title,
.equipment-create-header .room-edit-input-title {
    flex: 1;
}

/* Description display/edit toggle */
.room-card-description-edit {
    display: none;
}

/* ============================================
   BOOKING STYLES
   ============================================ */

/* Actions Bar */
.actions-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 8px;
}

.actions-left,
.actions-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* Booking Cards */
.bookings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.booking-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.booking-card:last-child {
    margin-bottom: 0;
}

.booking-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.booking-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1F2937;
}

.booking-title a {
    color: #1F2937;
    text-decoration: none;
}

.booking-title a:hover {
    color: var(--color-primary, #003D83);
}

.booking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 16px;
}

.booking-meta > div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.booking-meta svg {
    width: 16px;
    height: 16px;
}

/* Expandable Booking Card Header */
.booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: -16px;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.booking-card-header:hover {
    background: #FFEDD5;
}

.booking-card-header:hover .booking-title,
.booking-card-header:hover .booking-meta,
.booking-card-header:hover .booking-meta svg {
    color: #F97316;
}

.booking-card-main {
    flex: 1;
    min-width: 0;
}

.booking-card-main .booking-meta {
    margin-bottom: 0;
}

.booking-card-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.booking-card-right > .badge {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}


/* Expandable Booking Card Content */
.booking-card-content {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
}

.booking-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.booking-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.booking-detail-row--vertical {
    flex-direction: column;
    gap: 8px;
}

.booking-detail-label {
    font-size: 0.85rem;
    color: #6B7280;
    flex-shrink: 0;
}

.booking-detail-value {
    font-weight: 500;
    color: #1F2937;
    text-align: right;
}

.booking-detail-row--vertical .booking-detail-value {
    text-align: left;
}

.booking-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.booking-requirement-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #F3F4F6;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #374151;
}

/* Booking Tasks List */
.booking-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.booking-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #F9FAFB;
    border-radius: 6px;
    gap: 12px;
}

.booking-task-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.booking-task-name {
    font-size: 0.9rem;
    color: #1F2937;
}

.booking-task-assignee-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.booking-task-assignee-label {
    font-size: 0.8rem;
    color: #6B7280;
}

.booking-task-assignee {
    font-size: 0.8rem;
    color: var(--color-primary, #003D83);
    text-decoration: none;
}

.booking-task-assignee:hover {
    text-decoration: underline;
}

.booking-task-item .badge {
    flex-shrink: 0;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.booking-card-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Expanded state */
.booking-card.expanded {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.booking-card.room-highlight {
    box-shadow: 0 0 0 3px var(--color-primary, #003D83);
    transition: box-shadow 0.5s ease;
}

.booking-card:not(.room-highlight) {
    transition: box-shadow 0.8s ease;
}

.booking-show-header {
    padding: 20px 24px;
}

.booking-show-header h1 {
    color: var(--color-primary, #003D83);
}

.booking-actions-card {
    padding: 12px 24px;
    margin-bottom: 20px;
}

.booking-actions-card .booking-card-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    justify-content: space-between;
    align-items: center;
}

.booking-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Booking Details */
.booking-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.detail-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
}

.detail-card.detail-card-full {
    grid-column: 1 / -1;
}

.detail-card h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row.detail-row-full {
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 0.85rem;
    color: #6B7280;
}

.detail-value {
    font-weight: 500;
    color: #1F2937;
}

.detail-link {
    color: var(--color-primary, #003D83);
    text-decoration: none;
    font-weight: 500;
}

.detail-link:hover {
    text-decoration: underline;
}

/* Page Tabs */
.page-tabs {
    display: flex;
    flex-wrap: wrap;
    background: white;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.page-tabs .page-tab {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    background: #F3F4F6;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.page-tabs .page-tab:hover {
    background: #FFEDD5;
    color: #F97316;
}

.page-tabs .page-tab.active {
    background: var(--color-primary, #003D83);
    color: white;
}

.page-tabs .page-tab.active:hover {
    background: var(--color-primary, #003D83);
    color: white;
}

.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: rgba(0, 0, 0, 0.1);
    color: inherit;
    border-radius: 10px;
}

.page-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: inherit;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.config-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9CA3AF;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
}

.config-list-empty-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Config Form (inline create/edit) */
.config-form-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}

.config-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.config-form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1F2937;
}

/* Forms */
.booking-form {
    /* Full width - no max-width constraint */
}

.form-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
}

.form-section h2 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1F2937;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

/* Collapsible Form Section */
.form-section--collapsible .form-section-header--toggle {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    margin: -24px;
    padding: 24px;
    border-radius: 8px;
}

.form-section--collapsible .form-section-header--toggle:hover {
    background: #FFEDD5;
}

.form-section--collapsible .form-section-header--toggle h2 {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section--collapsible .form-section-header--toggle .form-hint {
    margin: 4px 0 0 0;
}

.form-section-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #6B7280;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.form-section-toggle svg {
    width: 20px;
    height: 20px;
}

.form-section-toggle.rotated {
    transform: rotate(180deg);
}

.form-section-content {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    margin-bottom: 6px;
}

/* Form Controls */
.ressourcen-page .form-control,
.form-section .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: #1F2937;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ressourcen-page .form-control:focus,
.form-section .form-control:focus {
    outline: none;
    border-color: var(--color-primary, #003D83);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.ressourcen-page .form-control::placeholder,
.form-section .form-control::placeholder {
    color: #9CA3AF;
}

/* Date and time inputs specific styling */
.form-section input[type="date"],
.form-section input[type="time"] {
    min-height: 42px;
}

.form-section-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.form-section-header h2 {
    margin: 0 0 4px 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-row--auto {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 600px) {
    .form-row--auto {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .form-row--auto {
        grid-template-columns: 1fr 1fr;
    }
}

.form-row--auto .form-group {
    margin-bottom: 0;
}

.form-hint-box {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-hint-box--warning {
    background: #FEF3C7;
    color: #92400E;
}

.form-hint-icon {
    font-size: 1.1rem;
}

.form-alert {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.form-alert--error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.empty-state-inline {
    display: none;
    text-align: center;
    padding: 32px;
    color: #6B7280;
}

.empty-state-inline p {
    margin: 0;
}

.empty-state-hint {
    margin-top: 8px;
    font-size: 0.85rem;
}

.form-hint {
    font-size: 0.85rem;
    color: #6B7280;
    margin: 0 0 16px 0;
}

.form-section h2 + .form-hint {
    margin-top: -8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 20px;
}

/* Room Selection Cards (booking form) */
.ressourcen-page .room-card,
.room-bookings-page .room-card,
.room-booking-create-page .room-card {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 16px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ressourcen-page .room-card:hover:not(.room-disabled),
.room-bookings-page .room-card:hover:not(.room-disabled),
.room-booking-create-page .room-card:hover:not(.room-disabled) {
    border-color: rgba(0, 61, 131, 0.4);
    background: rgba(0, 61, 131, 0.04);
}

.ressourcen-page .room-card.room-selected,
.room-bookings-page .room-card.room-selected,
.room-booking-create-page .room-card.room-selected {
    border-color: var(--color-primary, #003D83);
    background: rgba(0, 61, 131, 0.08);
}

.room-card .room-status-badge--selected {
    background: var(--color-primary, #003D83);
    color: white;
}

/* Room card in booking form */
.ressourcen-page .room-card .room-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.ressourcen-page .room-card .room-card-name {
    font-weight: 600;
    color: #1F2937;
    font-size: 1rem;
}

.ressourcen-page .room-card .room-status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: #D1FAE5;
    color: #065F46;
}

.ressourcen-page .room-card .room-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #6B7280;
    margin-bottom: 10px;
}

.ressourcen-page .room-card .room-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ressourcen-page .room-card .room-equipment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ressourcen-page .room-card .room-equipment-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: #E5E7EB;
    border-radius: 10px;
    color: #374151;
}

.ressourcen-page .room-card .room-mismatch-reason {
    display: none;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #DC2626;
}

.ressourcen-page .room-card.room-disabled,
.room-card.room-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ressourcen-page .room-card.room-disabled:hover,
.room-card.room-disabled:hover {
    border-color: transparent;
    background: #F9FAFB;
}

/* Equipment Chips */
.equipment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 14px;
    background: #F3F4F6;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.equipment-chip:hover {
    background: #E5E7EB;
}

.equipment-chip.selected {
    background: rgba(0, 61, 131, 0.08);
    border-color: var(--color-primary, #003D83);
}

.equipment-chip.selected span {
    color: var(--color-primary, #003D83);
}

/* Availability Indicator */
#availability-indicator {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#availability-indicator.available {
    background: #D1FAE5;
    color: #065F46;
}

#availability-indicator.unavailable {
    background: #FEE2E2;
    color: #991B1B;
}

/* Timeline Container */
.timeline-container {
    display: none;
    margin-top: 20px;
}

.timeline-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.timeline-legend {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
}

.timeline-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6B7280;
}

.timeline-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.timeline-legend-swatch--booked {
    background: #FEE2E2;
    border: 1px solid #F87171;
}

.timeline-legend-swatch--selection {
    background: rgba(0, 61, 131, 0.25);
    border: 2px solid var(--color-primary, #003D83);
}

.timeline-date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date-label {
    font-size: 0.85rem;
    color: #1F2937;
    font-weight: 500;
    min-width: 180px;
    text-align: center;
}

/* Vertical Day Timeline */
.vertical-timeline {
    position: relative;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
}

.timeline-hour-row {
    display: flex;
    align-items: stretch;
    min-height: 36px;
    border-bottom: 1px solid #E5E7EB;
}

.timeline-hour-row:last-of-type {
    border-bottom: none;
}

.timeline-hour-row:nth-child(even) {
    background: #F3F4F6;
}

.timeline-hour-label {
    width: 56px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6B7280;
    border-right: 1px solid #E5E7EB;
    background: white;
}

.timeline-hour-track {
    flex: 1;
    position: relative;
}

.timeline-bookings-layer {
    position: absolute;
    top: 0;
    left: 56px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.timeline-booking-block {
    position: absolute;
    left: 0;
    right: 0;
    background: #FEE2E2;
    border-top: 1px solid #FECACA;
    border-bottom: 1px solid #FECACA;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    overflow: hidden;
    z-index: 1;
    pointer-events: auto;
    cursor: default;
}

.timeline-booking-block .booking-info {
    font-size: 0.75rem;
    font-weight: 500;
    color: #991B1B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-booking-block .booking-info a {
    color: #7F1D1D;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.timeline-booking-block .booking-info a:hover {
    color: #450A0A;
    text-decoration-style: solid;
}

.timeline-selection-indicator {
    position: absolute;
    left: 56px;
    right: 0;
    background: rgba(0, 61, 131, 0.25);
    border-top: 2px solid var(--color-primary, #003D83);
    border-bottom: 2px solid var(--color-primary, #003D83);
    display: none;
    z-index: 2;
    pointer-events: none;
}

.timeline-selection-indicator.has-conflict {
    background: rgba(239, 68, 68, 0.2);
    border-top-color: #EF4444;
    border-bottom-color: #EF4444;
}

.timeline-selection-indicator .selection-time {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary, #003D83);
    white-space: nowrap;
}

.timeline-selection-indicator.has-conflict .selection-time {
    color: #DC2626;
}

/* Timeline Date Navigation Buttons */
.timeline-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    background: white;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.15s ease;
}

.timeline-nav-btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
    color: #1F2937;
}

.timeline-nav-btn:active {
    background: #E5E7EB;
}

.timeline-nav-btn svg {
    width: 16px;
    height: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: white;
    border-radius: 8px;
}

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

.empty-state-text {
    color: #6B7280;
    margin-bottom: 20px;
    font-size: 1rem;
}

/* Back Link */
.back-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6B7280;
    text-decoration: none;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--color-primary, #003D83);
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 8px;
    border-left: 3px solid var(--color-primary, #003D83);
}

.history-action-created {
    border-left-color: #9CA3AF;
}

.history-action-acknowledged {
    border-left-color: var(--color-primary, #003D83);
}

.history-action-completed {
    border-left-color: var(--color-success, #28a745);
}

.history-action-cancelled {
    border-left-color: var(--color-danger, #dc3545);
}

.history-time {
    font-size: 0.8rem;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.history-description {
    font-size: 0.9rem;
    color: #1F2937;
}

/* Service Items (merged services + tasks) */
.service-items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    background: #F9FAFB;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary, #003D83);
}

.service-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.service-item-name {
    font-weight: 500;
    color: #1F2937;
}

.service-item-note {
    font-size: 0.85rem;
    color: #6B7280;
}

.service-item-note--secondary {
    color: #9CA3AF;
    font-style: italic;
}

.service-item-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: #6B7280;
    padding-top: 4px;
    border-top: 1px solid #E5E7EB;
}


/* ============================================
   Unified Filter Components
   ============================================
   A consistent pattern for all filter/option UI components:
   - .filter-section: Container for a filter category
   - .filter-grid: Grid layout for filter items
   - .filter-item: Base styling for all selectable items
   - Modifiers: --toggle (simple), --detail (with description), --input (with input field)
   ============================================ */

.filter-section {
    margin-bottom: 20px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-header {
    margin-bottom: 12px;
}

.filter-section-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1F2937;
    margin-bottom: 4px;
}

.filter-section-hint {
    font-size: 0.8rem;
    color: #6B7280;
    margin: 0;
}

/* Grid layout - adapts to content type */
.filter-grid {
    display: grid;
    gap: 10px;
}

.filter-grid--toggle,
.filter-grid--detail,
.filter-grid--input {
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .filter-grid--toggle,
    .filter-grid--detail,
    .filter-grid--input {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Booking tabs stay single-column: cards have expandable content
   and negative-margin headers that break in a 2-column grid */

/* Base filter item - consistent for all types */
.filter-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 14px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.15s ease;
}

.filter-item:hover {
    background: #F3F4F6;
    border-color: #E5E7EB;
}

.filter-item.selected,
.filter-item:has(input:checked) {
    background: rgba(0, 61, 131, 0.08);
    border-color: var(--color-primary, #003D83);
}

.filter-item.selected:hover,
.filter-item:has(input:checked):hover {
    background: rgba(0, 61, 131, 0.12);
    border-color: var(--color-primary, #003D83);
}

/* Checkbox styling - always visible */
.filter-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--color-primary, #003D83);
}

/* Filter item content */
.filter-item-content {
    flex: 1;
    min-width: 0;
}

.filter-item-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1F2937;
}

.filter-item.selected .filter-item-label,
.filter-item:has(input:checked) .filter-item-label {
    color: var(--color-primary, #003D83);
}

.filter-item-description {
    display: block;
    font-size: 0.8rem;
    color: #6B7280;
    margin-top: 2px;
}

/* Input variant - for numeric filters like capacity */
.filter-item--input {
    padding: 10px 14px;
}

.filter-item--input .filter-item-label {
    font-size: 0.8rem;
    font-weight: 400;
    color: #6B7280;
    margin-bottom: 4px;
}

.filter-item--input input[type="number"],
.filter-item--input input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-item--input input[type="number"]:focus,
.filter-item--input input[type="text"]:focus {
    outline: none;
    border-color: var(--color-primary, #003D83);
    box-shadow: 0 0 0 3px rgba(0, 61, 131, 0.1);
}

.filter-item--input input[type="number"]::placeholder,
.filter-item--input input[type="text"]::placeholder {
    color: #9CA3AF;
}

/* Input card highlight when has value */
.filter-item--input:has(input:not(:placeholder-shown)) {
    background: rgba(0, 61, 131, 0.08);
    border-color: var(--color-primary, #003D83);
}

.filter-item--input:has(input:not(:placeholder-shown)) .filter-item-label {
    color: var(--color-primary, #003D83);
}

/* Compact toggle variant - slightly smaller padding */
.filter-item--toggle {
    padding: 10px 14px;
}

/* Empty state for filter sections */
.filter-empty {
    font-size: 0.85rem;
    color: #9CA3AF;
    font-style: italic;
    padding: 12px 0;
}

/* ============================================
   Step Detail Page
   ============================================ */

.step-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.step-link {
    color: var(--color-primary, #003D83);
    text-decoration: none;
    font-weight: 500;
}

.step-link:hover {
    text-decoration: underline;
    color: #002a5c;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

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

    .search-wrapper {
        min-width: unset;
    }

    .ressourcen-page-header,
    .form-section,
    .detail-card,
    .booking-card,
    .actions-bar {
        padding: 16px;
    }

    .page-tabs {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .page-tabs .page-tab {
        text-align: center;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .actions-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
    }

    .actions-left,
    .actions-right {
        justify-content: center;
    }

    .booking-actions {
        flex-direction: column;
    }

    .booking-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .booking-details-grid {
        grid-template-columns: 1fr;
    }

    .equipment-chip {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Filter sections responsive */
    .filter-item {
        padding: 10px 12px;
    }

    .filter-item-label {
        font-size: 0.85rem;
    }

    .step-actions {
        flex-direction: column;
    }

    .step-actions .btn {
        width: 100%;
        justify-content: center;
    }

}

/* =========================================================================
   Service Task Assignments (expanded card section)
   ========================================================================= */

.service-task-assignments {
    margin-top: 8px;
}

.service-task-assignments .relationship-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.service-task-assignments .service-assignment-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 6px;
}

.service-task-assignments .service-assignment-label:not(:first-child) {
    margin-top: 10px;
}

.service-tasks-list .relationship-item {
    --entity-color: var(--color-tasks);
}

.service-departments-list .relationship-item {
    --entity-color: var(--color-departments);
}

.service-employees-list .relationship-item {
    --entity-color: var(--color-employees);
}

.service-no-task-hint {
    font-size: 0.85rem;
    color: #6B7280;
    margin-top: 8px;
}

/* Task section edit mode: intensified border + tinted background */
.service-task-section.edit-mode .service-tasks-list .relationship-item {
    border-left-color: var(--entity-color);
    background-color: color-mix(in srgb, var(--entity-color) 6%, white);
}

.service-task-section.edit-mode .service-no-task-hint {
    color: #9A3412;
}

/* =========================================================================
   Room Photo Gallery
   ========================================================================= */

.room-photo-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E5E7EB;
}

.room-photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.room-photo-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s;
}

.room-photo-thumb:hover {
    border-color: var(--primary, #2563EB);
}

.room-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.room-photo-primary-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.7rem;
    color: #F59E0B;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1;
}

.room-photo-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.15s;
}

.room-photo-thumb:hover .room-photo-actions {
    opacity: 1;
}

.room-photo-action-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 1px 4px;
    line-height: 1;
    border-radius: 2px;
}

.room-photo-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.room-photo-action-delete:hover {
    color: #EF4444;
}

/* Hide photo edit controls unless card is in edit mode */
.booking-card:not([data-edit-mode="true"]) .room-photo-upload-btn,
.booking-card:not([data-edit-mode="true"]) .room-photo-actions {
    display: none;
}

.room-photo-upload-btn {
    width: 64px;
    height: 64px;
    border: 2px dashed #D1D5DB;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #9CA3AF;
    font-size: 1.5rem;
    transition: border-color 0.15s, color 0.15s;
}

.room-photo-upload-btn:hover {
    border-color: var(--primary, #2563EB);
    color: var(--primary, #2563EB);
}

/* =========================================================================
   Room Photo Lightbox
   ========================================================================= */

.room-photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.room-photo-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 8px;
    z-index: 1;
}

.room-photo-lightbox-close:hover {
    color: #D1D5DB;
}

.room-photo-lightbox-prev,
.room-photo-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 12px 16px;
    line-height: 1;
    border-radius: 4px;
    z-index: 1;
    transition: background 0.15s;
}

.room-photo-lightbox-prev:hover,
.room-photo-lightbox-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.room-photo-lightbox-prev {
    left: 16px;
}

.room-photo-lightbox-next {
    right: 16px;
}

.room-photo-lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.room-photo-lightbox-caption {
    color: #D1D5DB;
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
}

/* =========================================================================
   Room Card Thumbnail (Booking Page)
   ========================================================================= */

.room-card-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Room card header with thumbnail */
.booking-card-main:has(.room-card-thumbnail) {
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-card-header-text {
    min-width: 0;
    flex: 1;
}

/* =========================================================================
   Room Photo Responsive
   ========================================================================= */

@media (min-width: 1200px) {
    .room-detail-sections {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .room-photo-thumb {
        width: 100px;
        height: 100px;
    }

    .room-photo-upload-btn {
        width: 100px;
        height: 100px;
    }

    .room-photo-primary-badge {
        font-size: 0.85rem;
        top: 4px;
        left: 4px;
    }

    .room-photo-action-btn {
        font-size: 0.8rem;
        padding: 2px 6px;
    }
}

@media (min-width: 2100px) {
    .room-detail-sections {
        grid-template-columns: repeat(4, 1fr);
    }

    .room-photo-thumb {
        width: 140px;
        height: 140px;
    }

    .room-photo-upload-btn {
        width: 140px;
        height: 140px;
    }
}
