/* ============================================================
   Notiz-App Custom Styles
   ============================================================ */

:root {
    --sidebar-width: 280px;
    --navbar-height: 56px;
    --footer-height: 76px;
    --primary: #EA580C;       /* Tailwind Orange 600 */
    --primary-dark: #C2410C;  /* Tailwind Orange 700 */
    --bg-sidebar: #f8f9fa;
    --bg-main: #ffffff;
    --text-muted: #6B7280;
    --border-color: #e5e7eb;

    /* Bootstrap-Primary an eigene Palette koppeln */
    --bs-primary: var(--primary);
    --bs-primary-rgb: 234, 88, 12;
    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-dark);
    --bs-link-color-rgb: 234, 88, 12;
    --bs-link-hover-color-rgb: 194, 65, 12;
}

/* Bootstrap Button-Overrides (haben eigene CSS-Variablen) */
.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--primary);
    --bs-btn-active-border-color: var(--primary);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(234, 88, 12, 0.2);
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Gast-Navbar Links */
.nav-link-guest {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.15s ease;
}
.nav-link-guest:hover {
    color: var(--primary);
}

/* Smooth Scroll + Offset für sticky Navbar */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 70px;
}

/* Body */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f3f4f6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-notiz {
    height: var(--navbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1040;
}
.navbar-notiz .navbar-brand {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.25rem;
}
.navbar-notiz .nav-link {
    color: #374151;
    font-weight: 500;
}
.navbar-notiz .nav-link:hover,
.navbar-notiz .nav-link.active {
    color: var(--primary);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: var(--footer-height);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.3s ease;
}
.sidebar .notebook-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 0.375rem;
    margin: 0.125rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
}
.sidebar .notebook-item:hover {
    background: #e5e7eb;
}
.sidebar .notebook-item.active {
    background: var(--primary);
    color: #fff;
}
.sidebar .notebook-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.sidebar .nb-edit-btn {
    opacity: 1;
}
.sidebar .notebook-item-draggable {
    cursor: grab;
}
.sidebar .notebook-item-draggable:active {
    cursor: grabbing;
}
.sidebar .notebook-item.dragging {
    opacity: 0.4;
}
.sidebar .notebook-item.drag-over-top {
    box-shadow: inset 0 2px 0 0 var(--primary);
}
.sidebar .notebook-item.drag-over-bottom {
    box-shadow: inset 0 -2px 0 0 var(--primary);
}
.sidebar-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
.sidebar-section-divider {
    margin: 2.25rem 0 0.25rem;
    border: 0;
    border-top: 1px solid var(--border-color);
    opacity: 1;
}
.notebook-section-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-sidebar);
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-add-notebook {
    padding: 0.2rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.3;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.sidebar-add-notebook .bi {
    font-size: 0.85rem;
}
/* "Neues Notizbuch"-Einladung am Listenende */
.notebook-item-add {
    border: 1px dashed #198754;
    background: transparent !important;
    color: var(--text-muted) !important;
    justify-content: center;
    font-style: italic;
    margin-top: 0.5rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.notebook-item-add:hover {
    border-color: #157347;
    color: #157347 !important;
}
.sidebar-trash {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.sidebar .notebook-item-trash {
    color: #6b7280;
}
.sidebar .notebook-item-trash:hover {
    color: #b91c1c;
    background: #fef2f2;
}
.sidebar .notebook-item-trash.active {
    background: #b91c1c;
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--navbar-height) + 1rem);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 2rem;
    min-height: calc(100vh - var(--footer-height));
}

/* Note Cards */
.note-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.note-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.1);
}
.note-card .note-title {
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 0.25rem;
}
.note-card .note-snippet {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.note-card .note-meta {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 0.5rem;
}
.note-card.pinned {
    border-left: 3px solid var(--primary);
}

/* Papierkorb-Ansicht: Erstellen-Buttons ausblenden (greift auch bei Bootstrap d-*-flex) */
body.is-trash-view .new-entry-actions {
    display: none !important;
}

/* Datei-Kacheln */
.file-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.file-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.file-card-thumb {
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}
.file-card-zoom {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    transition: background 0.15s ease, transform 0.15s ease;
    font-size: 0.85rem;
    z-index: 2;
}
.file-card-zoom:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.08);
}
.file-card-extra-count {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 999px;
    z-index: 2;
    line-height: 1.4;
    font-weight: 500;
    pointer-events: none;
}
.file-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.file-card-body {
    padding: 0.5rem 0.75rem 0.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.file-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.file-card-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
    min-width: 0;
}
.file-card-meta .nb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.file-card-meta .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-card-summary {
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.4;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    border-top: 1px dashed var(--border-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* PDF-Kachel: Summary im Thumb-Bereich (statt Datei-Icon) */
.file-card-pdf-summary {
    width: 100%;
    height: 100%;
    padding: 0.6rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    background: linear-gradient(to bottom, #fff7ed 0%, #fff 50%);
}
.file-card-pdf-summary .pdf-summary-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.file-card-pdf-summary .pdf-summary-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #374151;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    flex-grow: 1;
}
.file-card-pdf-summary .pdf-summary-processing {
    color: #9A3412;
    background: #FFEDD5;
    padding: 0.3rem 0.5rem;
    border-radius: 0.25rem;
    font-style: italic;
    font-weight: 500;
    animation: aiProcessingPulse 2s ease-in-out infinite;
}

/* Diktat-Modal: "Ich höre zu"-Anzeige */
.dictate-recording {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #374151;
    font-size: 0.95rem;
    padding: 0.5rem 0.9rem;
    background: #fef2f2;
    border-radius: 999px;
    animation: dictatePulse 1.5s ease-in-out infinite;
}
@keyframes dictatePulse {
    0%, 100% { background: #fef2f2; }
    50% { background: #fee2e2; }
}

/* Lightbox (für Bild-Anhänge) */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2rem;
    animation: lightboxFadeIn 0.15s ease;
    overflow: hidden;
}
@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.lightbox-stage {
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}
.lightbox-overlay img {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 0.25rem;
    cursor: zoom-in;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}
.lightbox-caption {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 999px;
    max-width: 90vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Flatpickr: Tage mit Terminen markieren */
.flatpickr-day.has-event {
    position: relative;
}
.flatpickr-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
}
.flatpickr-day.has-event.selected::after,
.flatpickr-day.has-event.startRange::after,
.flatpickr-day.has-event.endRange::after {
    background: #fff;
}

/* Tages-Termine-Übersicht im Termin-Editor */
.day-appointments .day-apt-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-top: 1px solid #e5e7eb;
}
.day-appointments .day-apt-item:first-child {
    border-top: none;
}
.day-appointments .day-apt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.day-appointments .day-apt-time {
    font-variant-numeric: tabular-nums;
    color: #6b7280;
    min-width: 90px;
    flex-shrink: 0;
}
.day-appointments .day-apt-title {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.day-appointments .day-apt-empty {
    color: #9ca3af;
    font-style: italic;
}

/* Inline-Suche */
.note-search-bar {
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}
.note-search-input {
    border: 1px solid var(--border-color);
    background: #fff;
    padding-left: 2.25rem;
    padding-right: 2.25rem;
    font-size: 1rem;
    border-radius: 0.375rem;
}
.note-search-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.15rem rgba(234, 88, 12, 0.15);
    outline: none;
}
.note-search-icon {
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 1.1rem;
    pointer-events: none;
}
.note-search-clear {
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}
.note-search-clear:hover {
    color: #374151;
}

/* Editor Modal/Offcanvas */
.note-editor-offcanvas {
    width: 60% !important;
    max-width: 900px;
    top: 10px !important;
    bottom: 10px !important;
    height: auto !important;
}
.note-editor-offcanvas .note-editor-title {
    border: none;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0;
    width: 100%;
    outline: none;
}
.note-editor-offcanvas .note-editor-title::placeholder {
    color: #D1D5DB;
}

/* Calendar Page */
.fc .fc-button-group {
    gap: 0.25rem;
}
.fc .fc-button-group > .fc-button {
    border-radius: 0.375rem !important;
}
.fc .fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.fc .fc-button-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.fc .fc-daygrid-event {
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 0.8rem;
}

/* Search */
.search-highlight {
    background: #FEF3C7;
    padding: 0 2px;
    border-radius: 2px;
}

/* Tags */
.tag-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Auth Pages */
.auth-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}
.auth-card .auth-logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: calc(var(--navbar-height) + 1rem);
    right: 1rem;
    z-index: 1050;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}
.flash-message.flash-hiding {
    animation: slideOut 0.3s ease forwards;
}

/* Tier Badge */
.tier-badge-free {
    background: #E5E7EB;
    color: #374151;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-weight: 600;
}
.tier-badge-pro {
    background: #D1FAE5;
    color: #065F46;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-weight: 600;
}

/* Onboarding Cards */
.onboarding-card {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    cursor: default;
}
.onboarding-card:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.1);
}

/* Mobile Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .note-editor-offcanvas {
        width: 100% !important;
    }
}

/* FullCalendar Mobile-Anpassungen */
@media (max-width: 767.98px) {
    .main-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .calendar-wrapper {
        padding: 0.5rem !important;
    }
    .fc .fc-toolbar.fc-header-toolbar {
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .fc .fc-toolbar-title {
        font-size: 1.05rem;
        line-height: 1.2;
    }
    .fc .fc-button {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    .fc .fc-button .fc-icon {
        font-size: 1rem;
    }
    .fc .fc-footer-toolbar.fc-toolbar {
        margin-top: 0.75rem;
        justify-content: center;
    }
    .fc .fc-daygrid-day-number,
    .fc .fc-col-header-cell-cushion {
        font-size: 0.75rem;
    }
    .fc .fc-daygrid-event {
        font-size: 0.7rem;
        padding: 1px 2px;
    }
    /* Monatsansicht auf Mobile: nur Startzeit anzeigen (Punkt + Titel ausblenden) */
    .fc .fc-daygrid-dot-event .fc-daygrid-event-dot,
    .fc .fc-daygrid-dot-event .fc-event-title {
        display: none;
    }
    .fc .fc-daygrid-dot-event .fc-event-time {
        font-weight: 600;
    }
    /* ListWeek-View etwas kompakter */
    .fc .fc-list-event-time,
    .fc .fc-list-event-title {
        font-size: 0.85rem;
    }
    .fc .fc-list-day-cushion {
        padding: 0.4rem 0.6rem !important;
    }
}

/* Wochenansicht: Header + Ganztägig-Zeile unter der App-Navbar sticky (Desktop & Mobile) */
.fc .fc-scrollgrid-section-sticky > * {
    top: var(--navbar-height) !important;
    background: #fff;
    z-index: 4;
}

/* Summernote Anpassungen */
.note-editor.note-frame {
    border: 1px solid var(--border-color) !important;
    border-radius: 0.375rem !important;
}
.note-editor .note-editing-area .note-editable {
    min-height: 300px;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 2px;
}

/* Attachment List */
.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
}
/* Upload Dropzone */
.upload-dropzone {
    border: 2px dashed #D1D5DB;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: #EFF6FF;
}
.upload-dropzone i {
    font-size: 2.5rem;
    color: #9CA3AF;
    display: block;
    margin-bottom: 0.5rem;
}
.upload-dropzone:hover i,
.upload-dropzone.dragover i {
    color: var(--primary);
}
.upload-dropzone p {
    color: #6B7280;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.upload-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.upload-dropzone .form-text {
    position: relative;
    z-index: 1;
}

.attachment-entry {
    margin-bottom: 0.5rem;
}
.attachment-entry .attachment-item {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}
.attachment-entry:has(.attachment-summary) .attachment-item {
    border-bottom: none;
}
.attachment-entry .attachment-summary {
    padding: 0.4rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-top: 1px dashed var(--border-color);
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    font-size: 0.82rem;
    color: #374151;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
}
.attachment-entry .attachment-processing {
    color: #9A3412;
    background: #FFEDD5;
    border-color: #FDBA74;
    border-top-style: solid;
    font-weight: 500;
    font-style: normal;
    animation: aiProcessingPulse 2s ease-in-out infinite;
}
@keyframes aiProcessingPulse {
    0%, 100% { background: #FFEDD5; }
    50%      { background: #FED7AA; }
}
.attachment-entry .attachment-failed {
    color: #b91c1c;
    background: #fef2f2;
}
.attachment-item .attachment-thumb {
    width: 54px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    background: #fff;
}
.attachment-item .attachment-name {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-item .attachment-size {
    flex-shrink: 0;
}
.attachment-item .attachment-download {
    flex-shrink: 0;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.2;
}
.attachment-item .attachment-remove {
    color: #EF4444;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    flex-shrink: 0;
}

/* ============================================================
   Browser Mockup (Startseite)
   ============================================================ */
.mockup-browser {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
.mockup-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}
.mockup-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.mockup-url {
    margin-left: 12px;
    font-size: 0.7rem;
    color: #9CA3AF;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 2px 10px;
    flex: 1;
}
.mockup-body {
    display: flex;
    min-height: 280px;
}
.mockup-sidebar {
    width: 160px;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 12px 8px;
    flex-shrink: 0;
}
.mockup-sidebar-title {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #9CA3AF;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0 6px;
    margin-bottom: 8px;
}
.mockup-nb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #374151;
    padding: 5px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
}
.mockup-nb.active {
    background: var(--primary);
    color: #fff;
}
.mockup-nb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mockup-nb.active .mockup-nb-dot {
    border: 1.5px solid rgba(255,255,255,0.6);
}
.mockup-nb-count {
    margin-left: auto;
    font-size: 0.6rem;
    opacity: 0.6;
}
.mockup-content {
    flex: 1;
    padding: 12px;
}
.mockup-note {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.mockup-note.pinned {
    border-left: 3px solid var(--primary);
}
.mockup-note-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}
.mockup-note-text {
    font-size: 0.68rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mockup-note-meta {
    font-size: 0.58rem;
    color: #9CA3AF;
    margin-top: 4px;
}

@media (max-width: 991.98px) {
    .mockup-sidebar {
        display: none;
    }
    .mockup-body {
        min-height: 220px;
    }
}

/* ============================================================
   Dokumenten-Scan: Thumbnail-Leiste im Scan-Modal
   ============================================================ */
.scan-pages-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    min-height: 120px;
    background: #F9FAFB;
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    align-content: flex-start;
}
.scan-pages-strip:empty::before {
    content: "";
    flex: 1;
}
.scan-page-tile {
    position: relative;
    width: 170px;
    height: 225px;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
@media (max-width: 575.98px) {
    .scan-pages-strip {
        flex-direction: column;
        align-items: center;
    }
    .scan-page-tile {
        width: 140px;
        height: 185px;
    }
}
.scan-page-tile:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}
.scan-page-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.scan-page-num {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(234, 88, 12, 0.95);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 2;
}
.scan-page-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.75);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s ease;
}
.scan-page-remove:hover {
    background: #b91c1c;
}
.scan-page-rotate {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.75);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s ease;
}
.scan-page-rotate:hover {
    background: rgba(234, 88, 12, 0.95);
}
