:root {
    --primary: #006747;
    --primary-dark: #004f37;
    --primary-light: #e6f2ee;
    --accent: #c8933a;
    --accent-hover: #b07d2a;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --border: #e3e6ec;
    --border-strong: #c8cdd6;
    --text: #111827;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 8px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
}

/* ─── HEADER ─────────────────────────────────────────────────────────────── */
.header {
    background: var(--primary);
    color: white;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.header-inner {
    max-width: 1020px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1rem;
}
.logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ─── MAIN NAV ───────────────────────────────────────────────────────────── */
.main-nav {
    display: flex;
    gap: 0.2rem;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 1rem;
    border-radius: 9px;
    text-decoration: none;
    color: rgba(255,255,255,0.72);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.nav-item svg { flex-shrink: 0; opacity: 0.9; }
.nav-item:hover {
    background: rgba(255,255,255,0.14);
    color: white;
}
.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}
.logout-link {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: color 0.15s;
}
.logout-link:hover { color: rgba(255,255,255,0.85); }

/* ─── BOTTOM NAV (mobile) ────────────────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    z-index: 200;
    padding: 0.4rem 0 env(safe-area-inset-bottom, 0.4rem);
    justify-content: space-around;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    padding: 0.3rem 1.2rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    transition: color 0.15s;
}
.bottom-nav-item svg { opacity: 0.7; }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active svg { opacity: 1; }

@media (max-width: 680px) {
    .main-nav { display: none; }
    .bottom-nav { display: flex; }
    body { padding-bottom: 5rem; }
    .logout-link {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
        background: rgba(255,255,255,0.12);
        border-radius: 6px;
    }
}

/* ─── CONTAINER ──────────────────────────────────────────────────────────── */
.container {
    max-width: 1020px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 2px 8px rgba(200,147,58,0.35); }
.btn-secondary { background: var(--primary); color: white; }
.btn-secondary:hover { background: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-full { width: 100%; padding: 0.75rem; font-size: 1rem; }

/* ─── PAGE HEADER ────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; flex: 1; letter-spacing: -0.02em; }
.page-header-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

/* ─── STATUS BADGES ──────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 20px;
    font-size: 0.775rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.badge-angenommen  { background: #dbeafe; color: #1d4ed8; }
.badge-in-arbeit   { background: #fef3c7; color: #92400e; }
.badge-fertig      { background: #d1fae5; color: #065f46; }
.badge-abgeholt    { background: #f3f4f6; color: #6b7280; }
.badge-lager       { background: #d1fae5; color: #065f46; }
.badge-verkauft    { background: #f3f4f6; color: #6b7280; }

/* ─── REPAIR LIST ────────────────────────────────────────────────────────── */
.repair-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.repair-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.repair-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.repair-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}
.repair-id { font-size: 0.775rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }
.repair-card-name { font-size: 1.05rem; font-weight: 700; }
.repair-card-watch { font-size: 0.875rem; color: var(--text-muted); margin-top: 0.1rem; }
.repair-card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ─── FILTER BAR ─────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.4rem;
    flex-wrap: wrap;
}
.search-input { flex: 1; min-width: 160px; }
.status-select { min-width: 150px; }

/* ─── FORMS ──────────────────────────────────────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.form-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin: 1.4rem 0 0.85rem;
    padding-bottom: 0.45rem;
    border-bottom: 1px solid var(--border);
}
.form-card > .form-section-title:first-child { margin-top: 0; }
.form-group { margin-bottom: 1rem; }
.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text);
}
.form-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.975rem;
    background: var(--surface);
    color: var(--text);
    appearance: auto;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,103,71,0.1);
}
.form-textarea { min-height: 88px; resize: vertical; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.85rem;
}
@media (max-width: 540px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
.form-actions { margin-top: 1.4rem; }
.form-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* ─── CUSTOMER SELECTOR ──────────────────────────────────────────────────── */
.customer-selector {
    background: var(--primary-light);
    border: 1.5px solid #b3d4c8;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.customer-selector-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}
.customer-selector select {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1.5px solid #b3d4c8;
    border-radius: 7px;
    font-size: 0.925rem;
    background: white;
    color: var(--text);
    cursor: pointer;
}
.customer-selector select:focus {
    outline: none;
    border-color: var(--primary);
}
.customer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
}
.customer-link:hover { text-decoration: underline; }

/* ─── PHOTOS ─────────────────────────────────────────────────────────────── */
.photos-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
}
.section-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.1rem;
    color: var(--text);
}
.photo-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
@media (max-width: 500px) {
    .photo-columns { grid-template-columns: 1fr; gap: 1.25rem; }
}
.photo-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.75rem;
}
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
}
.photo-thumb:hover { opacity: 0.85; transform: scale(1.03); }
.photo-upload-input { display: none; }
.photo-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--bg);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary);
    transition: border-color 0.15s, background 0.15s;
}
.photo-upload-label:hover { border-color: var(--accent); background: #fdf6ec; }
.photo-btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.photo-upload-label-secondary { color: var(--text-muted); }

/* ─── EMPTY STATE ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state p { margin-bottom: 1.4rem; font-size: 1rem; }

/* ─── CUSTOMER CARDS ─────────────────────────────────────────────────────── */
.customer-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}
.customer-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.customer-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
    transform: translateY(-1px);
}
.customer-card-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.customer-card-meta { font-size: 0.85rem; color: var(--text-muted); }
.customer-card-meta span { display: block; }

/* ─── CUSTOMER DETAIL ────────────────────────────────────────────────────── */
.customer-profile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.customer-name-big { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.75rem; }
.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-bottom: 1rem;
}
.customer-info-item { font-size: 0.9rem; }
.customer-info-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.15rem; }
.customer-info-value { color: var(--text); }

.subsection-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.subsection-count {
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}

/* ─── WATCH CARDS ────────────────────────────────────────────────────────── */
.watch-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.watch-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.watch-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.watch-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}
.watch-card-title { font-size: 1.05rem; font-weight: 700; }
.watch-card-ref { font-size: 0.825rem; color: var(--text-muted); margin-top: 0.1rem; }
.watch-card-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-wrap: wrap;
}
.watch-price { font-weight: 600; color: var(--text-muted); }
.watch-price-label { font-weight: 400; }

/* ─── WATCH DETAIL ───────────────────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 680px) {
    .detail-grid { grid-template-columns: 1fr; }
}
.kaufvertrag-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--surface-2);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}
.kaufvertrag-box.has-file {
    background: var(--primary-light);
    border-color: #b3d4c8;
    border-style: solid;
}

/* ─── KVA ────────────────────────────────────────────────────────────────── */
.kva-kunde { font-size: 1rem; font-weight: 700; }
.kva-kommission { font-weight: 400; color: var(--accent); font-size: 0.9rem; }
.kva-uhr { font-size: 0.875rem; color: var(--text-muted); margin-top: 2px; }
.kva-table { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.kva-header {
    display: grid;
    grid-template-columns: 36px 1fr 110px;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 0.25rem;
}
.kva-price-col { text-align: right; }
.kva-row {
    display: grid;
    grid-template-columns: 36px 1fr 110px;
    gap: 0.5rem;
    align-items: center;
}
.kva-checkbox {
    width: 20px; height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    justify-self: center;
}
.kva-label-wrap { display: flex; flex-direction: column; gap: 0.25rem; }
.kva-label { font-size: 0.95rem; }
.kva-note { font-size: 0.8rem; color: var(--text-muted); }
.kva-price { text-align: right; font-size: 0.95rem; }
.kva-totals {
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.kva-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.kva-total-final {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
}

/* ─── ALERT ──────────────────────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 9px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.blocked-repairs { margin: 0.5rem 0 0.5rem 1.25rem; padding: 0; }
.blocked-repairs li { margin: 0.2rem 0; }
.blocked-repairs a { color: #991b1b; text-decoration: underline; }

/* ─── STATS BAR ──────────────────────────────────────────────────────────── */
.stats-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}
.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    cursor: pointer;
}
.stat-pill:hover { opacity: 0.85; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.stat-pill.active { border-color: currentColor; box-shadow: var(--shadow-sm); }
.stat-count { font-size: 1rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.75rem; font-weight: 600; }
.stat-angenommen { background: #dbeafe; color: #1d4ed8; }
.stat-in-arbeit  { background: #fef3c7; color: #92400e; }
.stat-fertig     { background: #d1fae5; color: #065f46; }
.stat-abgeholt   { background: #f3f4f6; color: #6b7280; }
.stat-reset      { background: #fee2e2; color: #991b1b; font-size: 0.8rem; }

/* ─── REPAIR CARD WRAP (für Schnellstatus) ───────────────────────────────── */
.repair-card-wrap { display: flex; flex-direction: column; }
.quick-status-form { margin-top: -0.4rem; }
.quick-status-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    justify-content: center;
}
.quick-status-btn:hover { background: var(--primary-light); color: var(--primary-dark); }

/* ─── PIPELINE / KANBAN ──────────────────────────────────────────────────── */
.pipeline-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    align-items: start;
    overflow-x: auto;
    padding-bottom: 1rem;
}
@media (max-width: 900px) {
    .pipeline-board {
        grid-template-columns: repeat(4, minmax(220px, 1fr));
    }
}
.pipeline-col {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.pipeline-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 2px solid transparent;
}
.pipeline-header-angenommen { background: #dbeafe; border-color: #93c5fd; }
.pipeline-header-in-arbeit  { background: #fef3c7; border-color: #fcd34d; }
.pipeline-header-fertig     { background: #d1fae5; border-color: #6ee7b7; }
.pipeline-header-abgeholt   { background: #f3f4f6; border-color: #d1d5db; }
.pipeline-col-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.pipeline-header-angenommen .pipeline-col-title { color: #1d4ed8; }
.pipeline-header-in-arbeit  .pipeline-col-title { color: #92400e; }
.pipeline-header-fertig     .pipeline-col-title { color: #065f46; }
.pipeline-header-abgeholt   .pipeline-col-title { color: #6b7280; }
.pipeline-col-count {
    background: rgba(255,255,255,0.7);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    color: inherit;
}
.pipeline-cards { padding: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.pipeline-empty { text-align: center; padding: 1.5rem 0.5rem; font-size: 0.8rem; color: var(--text-light); }
.pipeline-card-wrap { display: flex; flex-direction: column; }
.pipeline-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 0.75rem 0.9rem;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, border-color 0.15s;
}
.pipeline-card:hover { box-shadow: var(--shadow); border-color: var(--accent); }
.pipeline-card-top { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.25rem; }
.pipeline-knr { font-size: 0.7rem; color: var(--accent); font-weight: 600; }
.pipeline-card-name { font-size: 0.95rem; font-weight: 700; }
.pipeline-card-watch { font-size: 0.8rem; color: var(--text-muted); }
.pipeline-card-location { font-size: 0.75rem; color: var(--text-light); margin-top: 0.2rem; }
.pipeline-card-date { font-size: 0.7rem; color: var(--text-light); margin-top: 0.3rem; }
.quick-status-btn-sm {
    font-size: 0.72rem;
    padding: 0.22rem 0.6rem;
    border-radius: 0 0 9px 9px;
}

/* ─── DELETE BUTTON ──────────────────────────────────────────────────────── */
.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1.5px solid #fca5a5;
}
.btn-danger:hover { background: #fecaca; border-color: #f87171; }

/* ─── WHATSAPP BUTTON ────────────────────────────────────────────────────── */
.btn-whatsapp {
    background: #25d366;
    color: white;
}
.btn-whatsapp:hover { background: #1ebe5d; }

/* ─── FOTO LÖSCHEN ───────────────────────────────────────────────────────── */
.photo-wrap {
    position: relative;
}
.photo-delete-form { position: absolute; top: 3px; right: 3px; margin: 0; }
.photo-delete-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(220,38,38,0.85);
    color: white;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0;
}
.photo-wrap:hover .photo-delete-btn { opacity: 1; }

/* ─── BTN SM ──────────────────────────────────────────────────────────────── */
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ─── LOGIN ──────────────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}
.login-box {
    background: white;
    border-radius: 20px;
    padding: 2.25rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    margin: 1rem;
}
.login-logo { font-size: 2.5rem; text-align: center; margin-bottom: 0.5rem; }
.login-title {
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}
.login-box-wide { max-width: 460px; }
.login-sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1.5rem;
    line-height: 1.5;
}
.login-foot {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.login-foot a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}
.login-foot a:hover { text-decoration: underline; }
.profile-form .form-row { margin-bottom: 0; }

/* ─── USER META (Header) ──────────────────────────────────────────────────── */
.user-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}
.user-display {
    color: rgba(255,255,255,0.92);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
}
.role-admin {
    background: var(--accent);
    color: #2d1f00;
}
.role-mitarbeiter {
    background: rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.95);
    border: 1px solid rgba(255,255,255,0.25);
}
.role-3rd_party {
    background: #d1fae5;
    color: #065f46;
}
@media (max-width: 680px) {
    .user-display { display: none; }
    .user-meta { gap: 0.4rem; }
}

/* ─── ADMIN PANEL ─────────────────────────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.muted {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.muted strong { color: var(--text); font-weight: 600; }
.hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 0.35rem;
    line-height: 1.45;
}
.inline-form {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    flex-wrap: wrap;
}
.inline-form .form-input { flex: 1 1 14rem; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}
.card .section-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.user-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface);
}
.user-table-head,
.user-table-row {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 1fr 1.6fr;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    align-items: center;
}
.user-table-head {
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.user-table-row {
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
}
.user-table-row:last-child { border-bottom: none; }
.user-username { font-weight: 600; color: var(--text); }
.user-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.user-actions .inline { display: inline; }

.btn-danger-ghost {
    background: transparent;
    color: #b91c1c;
    border: 1.5px solid #fecaca;
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.825rem;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-danger-ghost:hover {
    background: #fef2f2;
    border-color: #f87171;
}

.location-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 999px;
    font-size: 0.825rem;
    font-weight: 500;
}

@media (max-width: 680px) {
    .user-table-head { display: none; }
    .user-table-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        padding: 1rem;
    }
    .user-actions { justify-content: flex-start; margin-top: 0.4rem; }
}

.form-card .form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ─── 3RD PARTY DASHBOARD ─────────────────────────────────────────────────── */
.layout-minimal { padding-bottom: 2rem; }
.layout-minimal .container { max-width: 720px; padding-top: 1.25rem; }

.tp-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1.5rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.tp-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}
.tp-subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    line-height: 1.55;
}
.tp-subtitle strong { color: white; font-weight: 700; }

.tp-section {
    margin-bottom: 2rem;
}
.tp-section .section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.empty-state {
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s, transform 0.15s;
}
.tp-card:hover { box-shadow: var(--shadow); }
.tp-card-done {
    opacity: 0.65;
    background: var(--surface-2);
}
.tp-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.tp-status {
    display: inline-flex;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tp-status.status-Angenommen { background: #fef3c7; color: #92400e; }
.tp-status.status-In-Arbeit  { background: #dbeafe; color: #1e40af; }
.tp-status.status-Fertig     { background: #d1fae5; color: #065f46; }
.tp-status.status-Abgeholt   { background: #e5e7eb; color: #374151; }
.tp-commission {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tp-card-body { margin-bottom: 0.85rem; }
.tp-watch {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}
.tp-desc {
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.4rem;
    line-height: 1.5;
}
.tp-meta {
    font-size: 0.825rem;
    color: var(--text-muted);
}
.tp-card-action { margin-top: 0.6rem; }

.btn-large {
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
}

/* ─── BACK LINK ───────────────────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    transition: color 0.15s;
}
.back-link:hover { color: var(--primary); }
.page-header .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
