/**
 * app.css — Alle Styles für die Service am Bau PWA.
 *
 * Mobile-first, schlicht, große Touch-Targets.
 * Die Worker nutzen das auf Handys auf der Baustelle.
 */

/* ---------------------------------------------------------------------------
   Reset & Basis
   --------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-text: #2a2a2a;
    --color-text-muted: #666666;
    --color-primary: #5b1d1f;
    --color-primary-dark: #461518;
    --color-primary-light: #f4e8e9;
    --color-danger: #d93025;
    --color-danger-dark: #b3261e;
    --color-success: #1e8e3e;
    --color-warning: #f9ab00;
    --color-warning-bg: #fef7e0;
    --color-error-bg: #fce8e6;
    --color-error-text: #c5221f;
    --color-border: #d5d5d5;
    --color-link: #337ab7;
    --color-nav-bg: #ffffff;
    --radius: 4px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 2px 8px rgba(0,0,0,0.12);
}

html, body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
#app {
    padding: 16px;
    padding-bottom: 80px; /* Platz für Bottom-Nav */
    max-width: 480px;
    margin: 0 auto;
}

/* ---------------------------------------------------------------------------
   Bottom Navigation
   --------------------------------------------------------------------------- */
#nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--color-nav-bg);
    border-top: 1px solid var(--color-border);
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    padding: 4px 12px;
    transition: color 0.15s;
}

.nav-item span {
    margin-top: 2px;
}

.nav-item.nav-active {
    color: var(--color-primary);
}

@media (min-width: 600px) {
    html, body {
        font-size: 20px;
    }

    #app {
        max-width: 720px;
        padding: 24px;
        padding-bottom: 88px;
    }

    .nav-item {
        font-size: 0.8125rem;
        padding: 6px 16px;
    }
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-danger {
    background: var(--color-danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: var(--color-danger-dark);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--color-border);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1.0625rem;
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-success {
    background: var(--color-success);
    color: white;
}
.btn-success:hover:not(:disabled) {
    background: #1a7d37;
}

.btn-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    margin-top: 12px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="time"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem; /* min 16px — verhindert iOS-Zoom */
    font-family: inherit;
    background: #ffffff;
    color: var(--color-text);
    transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* ---------------------------------------------------------------------------
   Login
   --------------------------------------------------------------------------- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 360px;
    background: var(--color-surface);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand-name {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 2px;
    line-height: 1;
}

.login-brand-sub {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.login-card h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--color-text-muted);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.login-card .btn {
    margin-top: 20px;
}

/* ---------------------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------------------- */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.dashboard-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 1px;
}

.dashboard-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Clock Button / Card
   --------------------------------------------------------------------------- */
.clock-area {
    margin-bottom: 20px;
}

.clock-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--color-border);
}

.clock-card.clock-in {
    border-top-color: var(--color-success);
}

.clock-card.clocked-in {
    background: #fef2f2;
    border-top-color: var(--color-danger);
}

.clock-label {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.clock-sub {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.clock-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.clock-actions-equal .btn {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius);
}

/* "Andere Uhrzeit" — einblendbare Zeile */
.custom-time-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    align-items: center;
}

.custom-time-row[hidden] {
    display: none;
}

.custom-time-row input[type="time"] {
    flex: 1;
}

.custom-time-row .btn {
    flex-shrink: 0;
    border-radius: var(--radius);
    padding: 12px 20px;
}

/* ---------------------------------------------------------------------------
   Stale (offener Eintrag >24h)
   --------------------------------------------------------------------------- */
.clock-card.stale {
    background: var(--color-warning-bg);
    border: 2px solid var(--color-warning);
}

.clock-warning {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-danger);
    margin-bottom: 12px;
}

.clock-stale-info {
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 16px;
    line-height: 1.6;
}

.clock-stale-label {
    text-align: left;
    margin-top: 0;
    margin-bottom: 8px;
}

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

.stale-actions .btn:first-child,
.stale-actions .btn:last-child {
    flex: unset;
    width: 100%;
}

/* ---------------------------------------------------------------------------
   Error & Loading
   --------------------------------------------------------------------------- */
.error-msg {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-top: 12px;
}

.loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px;
}

/* ---------------------------------------------------------------------------
   Meine Zeiten
   --------------------------------------------------------------------------- */
.times-screen h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.times-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 8px;
}

.times-toggle {
    display: flex;
    gap: 4px;
}

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

.times-nav-label {
    font-size: 0.8125rem;
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* Summary */
.times-summary {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.summary-row:first-child {
    font-weight: 600;
    font-size: 1rem;
    padding-bottom: 8px;
}

.summary-row-muted {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.summary-row-warning {
    color: var(--color-danger);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

/* Day groups */
.times-day {
    margin-bottom: 12px;
}

.times-day-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 4px 4px 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Individual entries */
.time-entry {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 4px;
    box-shadow: var(--shadow);
}

.time-entry.entry-open {
    border-left: 3px solid var(--color-danger);
}

.time-entry.entry-edited {
    border-left: 3px solid var(--color-warning);
}

.entry-times {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entry-range {
    font-size: 0.9375rem;
    font-weight: 500;
}

.entry-hours {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-primary);
}

.entry-open .entry-hours {
    color: var(--color-danger);
    font-weight: 500;
    font-size: 0.8125rem;
}

.entry-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    font-style: italic;
}

.entry-actions {
    margin-top: 4px;
    text-align: right;
}

/* Correction form */
.correction-area {
    margin-top: 8px;
}

.correction-form {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 14px;
}

.correction-form label {
    margin-top: 8px;
    margin-bottom: 4px;
}

.correction-form label:first-child {
    margin-top: 0;
}

.correction-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.correction-actions .btn {
    flex: 1;
}

.times-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px 20px;
    font-size: 0.875rem;
}

.times-show-all {
    width: 100%;
    margin-top: 8px;
}

/* Break info */
.break-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.break-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Admin: Benutzerverwaltung
   --------------------------------------------------------------------------- */
.admin-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-users-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.toggle-inactive {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
    cursor: pointer;
}

.toggle-inactive input[type="checkbox"] {
    width: auto;
}

/* User cards */
.user-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.user-card.user-inactive {
    background: var(--color-bg);
}

.user-card.user-inactive .user-name,
.user-card.user-inactive .user-meta,
.user-card.user-inactive .user-email {
    opacity: 0.4;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 0.8125rem;
}

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

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.role-admin {
    background: #e8f0fe;
    color: var(--color-primary);
}

.role-worker {
    background: #e6f4ea;
    color: var(--color-success);
}

.role-foreman {
    background: #fef7e0;
    color: #7c4d00;
}

.badge-inactive {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

/* User forms (create + edit) */
.user-form {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.user-form h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.edit-form {
    margin-top: 10px;
    margin-bottom: 0;
}

.edit-area {
    margin-top: 0;
    width: 100%;
    flex-basis: 100%;
}

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.form-actions .btn {
    flex: 1;
    min-width: 0;
}

/* ---------------------------------------------------------------------------
   Admin: Health-Check (Dashboard)
   --------------------------------------------------------------------------- */
.health-area {
    margin-top: 8px;
}

.health-check {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.health-section {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--color-border);
}

.health-section-ok {
    border-left-color: var(--color-success);
}

.health-section-warning {
    border-left-color: var(--color-warning);
}

.health-section-neutral {
    border-left-color: var(--color-border);
}

.health-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.health-empty {
    font-size: 0.8125rem;
    color: var(--color-success);
}

.health-names {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Health items */
.health-item {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
}

.health-item:last-child {
    margin-bottom: 0;
}

.health-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-item-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.health-item-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.health-item-detail {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.health-item-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 2px;
}

/* Severity colors */
.health-yellow {
    background: var(--color-warning-bg);
}

.health-yellow .health-item-badge {
    background: var(--color-warning);
    color: #7c4d00;
}

.health-red {
    background: var(--color-error-bg);
}

.health-red .health-item-badge {
    background: var(--color-danger);
    color: white;
}

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

.health-normal .health-item-badge {
    background: var(--color-border);
    color: var(--color-text-muted);
}

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

/* ---------------------------------------------------------------------------
   Admin: Alle Zeiten
   --------------------------------------------------------------------------- */
.admin-times-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-times-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.admin-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-filters select {
    width: 100%;
}

.filter-dates {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-dates input[type="date"] {
    flex: 1;
}

.filter-dates span {
    color: var(--color-text-muted);
}

.entry-user-name {
    font-weight: 600;
    margin-right: 6px;
}

/* ---------------------------------------------------------------------------
   PDF Export
   --------------------------------------------------------------------------- */
.pdf-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.pdf-warning {
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning);
    border-radius: var(--radius);
    padding: 14px;
    margin-top: 12px;
}

.pdf-warning-text {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.pdf-warning-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.pdf-warning-actions {
    display: flex;
    gap: 8px;
}

/* ---------------------------------------------------------------------------
   Arbeitsaufträge
   --------------------------------------------------------------------------- */
.jobs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.jobs-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Job cards */
.job-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
    box-shadow: var(--shadow);
}

.job-card.job-assigned {
    border-left: 3px solid var(--color-primary);
}

.job-card.job-done {
    opacity: 0.6;
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.job-title {
    font-size: 0.9375rem;
    font-weight: 600;
}

.badge-open {
    background: #fff3e0;
    color: #e65100;
}

.badge-done {
    background: #e6f4ea;
    color: var(--color-success);
}

.job-detail {
    font-size: 0.8125rem;
    color: var(--color-text);
    margin-bottom: 3px;
    line-height: 1.5;
}

/* Schnellinfo-Block — visuell hervorgehoben */
.job-quick-info {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 8px 10px;
    margin: 0 0 6px;
}

/* Ressourcen-Block (Ansprechpartner, Kunde) */
.job-resources {
    padding: 6px 0;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Grid-Layout für Label/Wert-Paare */
.job-grid-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0 10px;
    margin-bottom: 2px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.job-grid-label {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.job-grid-label::after {
    content: ':';
}

.job-grid-value {
    color: var(--color-text);
}

.job-grid-bold {
    font-weight: 600;
}

.job-resources .job-grid-row {
    font-size: 0.75rem;
}

.job-resources .job-grid-label {
    font-size: 0.6875rem;
}

/* Zuweisungs-Zeile */
.job-assigned-line {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.job-assigned-badge {
    background: var(--color-primary-light);
    color: var(--color-primary);
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.6875rem;
}

/* Card Footer — Buttons und Kommentar-CTA */
.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--color-border);
    gap: 8px;
}

/* Kommentar-Button Varianten */
.job-comments-btn-filled {
    background: var(--color-primary-light) !important;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary) !important;
    font-weight: 500;
}

.job-comments-btn-empty {
    color: var(--color-text-muted) !important;
    border: 1px solid var(--color-border) !important;
    background: var(--color-surface) !important;
}

/* Admin-Aktionsleiste */
.job-admin-actions {
    display: flex;
    gap: 6px;
}

.job-btn-danger {
    color: var(--color-danger) !important;
}

.job-label {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-right: 4px;
}

.job-label::after {
    content: ':';
}

.job-link {
    color: var(--color-link);
    text-decoration: none;
}

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

.job-muted {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.job-notes-display {
    font-style: italic;
    color: var(--color-text-muted);
}

/* Checkbox group for user assignment */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text);
    margin: 0;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

/* Dashboard: Heutige Aufträge */
.today-jobs {
    margin-bottom: 16px;
}

.today-job-card {
    display: block;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 4px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--color-text);
}

.today-job-card.job-assigned {
    border-left: 3px solid var(--color-primary);
}

.today-job-card.job-done {
    opacity: 0.5;
}

.today-job-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.today-job-detail {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------------
   Auftrags-Notizen / Fotos
   --------------------------------------------------------------------------- */
.job-notes-area {
    margin-top: 0;
}

.notes-section {
    padding-top: 10px;
}

.notes-upload {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.file-input {
    display: none;
}

.file-label {
    cursor: pointer;
}

.file-name {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-text-input {
    flex: 1;
    min-width: 120px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.note-item {
    background: var(--color-bg);
    border-radius: 6px;
    padding: 8px 10px;
}

.note-photo {
    width: 100%;
    max-width: 300px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
}

.note-meta {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.note-content {
    font-size: 0.8125rem;
    color: var(--color-text);
}

/* ---------------------------------------------------------------------------
   Meldungen
   --------------------------------------------------------------------------- */
.reports-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.reports-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.report-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 6px;
    box-shadow: var(--shadow);
    border-left: 3px solid var(--color-danger);
}

.report-card.report-done {
    border-left-color: var(--color-success);
    opacity: 0.6;
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.report-device {
    font-size: 0.9375rem;
    font-weight: 600;
}

.badge-report-open {
    background: var(--color-error-bg);
    color: var(--color-danger);
}

.report-detail {
    font-size: 0.8125rem;
    color: var(--color-text);
    margin-bottom: 3px;
    line-height: 1.5;
}

.report-meta {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.report-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    flex-direction: column;
}

.report-card-footer {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------------------
   Lightbox (Foto-Vollansicht)
   --------------------------------------------------------------------------- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    touch-action: pinch-zoom;
}

.lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: var(--radius);
    touch-action: pinch-zoom;
}

.lightbox-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 1.375rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}