:root {
    --navy: #040c2c;
    --navy-light: #0a1540;
    --green: #a2c629;
    --green-hover: #b8d940;
    --green-light: rgba(162,198,41,0.08);
    --green-medium: rgba(162,198,41,0.18);
    --bg: #f4f5f7;
    --white: #ffffff;
    --text: #040c2c;
    --text-secondary: #5a6578;
    --text-muted: #8f95a3;
    --border: #e4e7ec;
    --border-light: #f0f1f3;
    --shadow-sm: 0 1px 3px rgba(4,12,44,0.05);
    --shadow-md: 0 4px 16px rgba(4,12,44,0.07);
    --radius: 12px;
    --radius-sm: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
body::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--green) 0%, var(--navy) 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* -- Top Navigation -- */
.topnav {
    background: var(--navy);
    padding: 0 40px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 3px;
    z-index: 100;
}
.topnav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.topnav-logo {
    height: 36px;
    width: auto;
    cursor: pointer;
}
.topnav-sep {
    width: 1px;
    height: 26px;
    background: rgba(255,255,255,0.15);
}
.topnav-title {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.01em;
}
.topnav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}
.topnav-meta {
    text-align: right;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    line-height: 1.5;
}
/* Notification & Sound toggles */
.notif-toggle, .sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}
.notif-toggle:hover, .sound-toggle:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.25);
}
.notif-toggle.active, .sound-toggle.active {
    color: var(--green);
    border-color: rgba(162,198,41,0.4);
    background: rgba(162,198,41,0.1);
}
.notif-toggle svg, .sound-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: none;
}
.notif-toggle.denied .notif-badge { display: block; }

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.logout-btn:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.25);
}
.logout-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* -- Nav Links -- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.nav-link:not(.active):hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.08);
}
.nav-link.active {
    color: var(--green);
    background: rgba(162,198,41,0.12);
    cursor: default;
}
.nav-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* -- Main Content -- */
.main {
    padding: 44px 32px 40px;
}

/* -- Stats Grid -- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 22px;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.stat-detail {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 6px;
}
.stat-card.accent {
    border-left: 4px solid var(--green);
    background: linear-gradient(135deg, rgba(162,198,41,0.04), var(--white));
}

/* -- Country Flag -- */
.country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 5px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* -- Country Filter -- */
.country-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.country-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--white);
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
}
.country-pill:hover {
    border-color: var(--green);
    color: var(--text);
}
.country-pill.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.pill-flag {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.pill-count {
    background: rgba(0,0,0,0.08);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.75rem;
}
.country-pill.active .pill-count {
    background: rgba(255,255,255,0.2);
}
.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    flex-shrink: 0;
}
.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--red, #e53e3e);
    background: rgba(229, 62, 62, 0.06);
    cursor: pointer;
    font-family: 'Jost', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--red, #e53e3e);
    white-space: nowrap;
    transition: all 0.2s ease;
}
.reset-btn:hover {
    background: var(--red, #e53e3e);
    color: var(--white);
}
.date-pill svg {
    opacity: 0.6;
}
.date-pill.active svg {
    opacity: 1;
}

/* -- Frachtraum Dropdown -- */
.frachtraum-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: -12px;
    margin-bottom: 20px;
}
.frachtraum-filter select {
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 36px 8px 14px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.frachtraum-filter select:hover {
    border-color: var(--green);
}
.frachtraum-filter select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(4,12,44,0.1);
}

/* -- FAB Search -- */
.search-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0;
}
.search-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--navy);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(4,12,44,0.25), 0 2px 8px rgba(4,12,44,0.15);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}
.search-fab-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 32px rgba(4,12,44,0.3), 0 2px 8px rgba(4,12,44,0.2);
}
.search-fab-btn:active { transform: scale(0.96); }
.search-fab-btn svg {
    width: 22px;
    height: 22px;
    color: var(--green);
    transition: transform 0.3s ease;
}
.search-fab.open .search-fab-btn {
    background: var(--green);
}
.search-fab.open .search-fab-btn svg {
    color: var(--navy);
    transform: rotate(90deg);
}
.search-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 56px;
    width: 56px;
    border-radius: 28px;
    background: var(--white);
    box-shadow: 0 6px 24px rgba(4,12,44,0.15), 0 2px 8px rgba(4,12,44,0.1);
    overflow: hidden;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-radius 0.3s ease;
    display: flex;
    align-items: center;
    padding-right: 56px;
    pointer-events: none;
    opacity: 0;
}
.search-fab.open .search-panel {
    width: min(480px, calc(100vw - 48px));
    border-radius: 28px;
    pointer-events: auto;
    opacity: 1;
}
.search-panel-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    width: 100%;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.2s ease 0s, transform 0.2s ease 0s;
}
.search-fab.open .search-panel-inner {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s ease 0.15s, transform 0.25s ease 0.15s;
}
.search-panel input {
    flex: 1;
    border: none;
    outline: none;
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    color: var(--text);
    background: transparent;
    min-width: 0;
}
.search-panel input::placeholder { color: var(--text-muted); }
.result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* -- Search backdrop (inactive, kept for markup compat) -- */
.search-backdrop {
    display: none;
}

/* -- Table Card -- */
.table-card {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
thead { position: sticky; top: 0; z-index: 10; }
th {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    padding: 10px 12px;
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
    border-bottom: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
th:hover { background: var(--navy-light); }
th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.35;
    font-size: 0.7rem;
    vertical-align: middle;
}
th.sorted .sort-icon {
    opacity: 1;
    color: var(--green);
}
.date-filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 2px 3px;
    margin-left: 4px;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    vertical-align: middle;
    line-height: 1;
}
.date-filter-icon:hover {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.12);
}
.date-filter-icon svg {
    width: 13px;
    height: 13px;
    display: block;
    pointer-events: none;
}
.date-filter-icon.active {
    color: var(--green);
    background: rgba(162,198,41,0.18);
}
.date-filter-popover {
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 190px;
    font-family: inherit;
}
.date-filter-popover input[type="date"] {
    padding: 6px 8px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text);
}
.date-filter-actions {
    display: flex;
    gap: 6px;
    justify-content: space-between;
}
.date-filter-actions button {
    font-size: 0.75rem;
    padding: 5px 10px;
    border: 1px solid var(--border-light);
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
}
.date-filter-actions button:hover {
    background: #f4f6f8;
}
.date-filter-popover #dateFilterClear {
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}
.date-filter-popover #dateFilterClear:hover {
    background: rgba(239,68,68,0.08);
}

/* -- Active date-filter chips (in frachtraum-filter row) -- */
.active-date-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.active-date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 10px;
    border-radius: 20px;
    background: rgba(162,198,41,0.12);
    border: 1px solid rgba(162,198,41,0.45);
    font-family: 'Jost', sans-serif;
    font-size: 0.8rem;
    color: var(--navy);
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.active-date-chip:hover {
    background: rgba(162,198,41,0.22);
    border-color: var(--green);
    box-shadow: 0 2px 8px rgba(162,198,41,0.18);
}
.active-date-chip-icon svg {
    width: 12px;
    height: 12px;
    display: block;
    color: var(--green);
}
.active-date-chip-label {
    font-weight: 500;
    letter-spacing: 0.01em;
}
.active-date-chip-sep {
    color: rgba(30,41,59,0.35);
    font-weight: 600;
}
.active-date-chip-value {
    font-variant-numeric: tabular-nums;
    color: var(--navy);
    font-weight: 600;
}
.active-date-chip-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(30,41,59,0.08);
    color: var(--navy);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.active-date-chip-close:hover {
    background: #ef4444;
    color: #fff;
    transform: rotate(90deg);
}
td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
tbody tr {
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
tbody tr.data-row:nth-child(4n+1) {
    background: #fafbfc;
}
tbody tr.data-row:hover {
    background: rgba(162,198,41,0.06);
}

/* -- Master Shipment Badge -- */
.master-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: #040c2c;
    color: #a2c629;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}

/* -- Status Badges -- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}
.status-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-empfangen { background: #dbeafe; color: #1e40af; }
.status-empfangen .dot { background: #3b82f6; }
.status-aktualisiert { background: #fcd34d; color: #78350f; }
.status-aktualisiert .dot { background: #b45309; }
.status-neu { background: #dcfce7; color: #166534; }
.status-neu .dot { background: #22c55e; }
.status-positioniert { background: rgba(162,198,41,0.15); color: #3d5a00; }
.status-positioniert .dot { background: #a2c629; }
.status-default { background: #f1f5f9; color: #475569; }
.status-default .dot { background: #94a3b8; }

/* -- Expandable Detail Rows -- */
.data-row.clickable { cursor: pointer; }
.data-row.clickable:hover { background: var(--green-light); }
.expand-icon {
    display: inline-block;
    width: 12px;
    font-size: 0.65rem;
    transition: transform 0.2s ease;
    color: #94a3b8;
    margin-right: 4px;
}
.expand-icon::before { content: '\25b6'; }
.data-row.expanded .expand-icon { transform: rotate(90deg); color: var(--green); }
.detail-row { background: #f8fafc; }
.detail-row td { padding: 0 !important; border-top: none !important; }
.detail-content {
    padding: 16px 24px 16px 40px;
    border-left: 3px solid var(--green);
    margin: 0;
}
.details-stale-hint {
    font-size: 0.8rem;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 10px;
}
.detail-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 16px;
    font-size: 0.85rem;
}
.detail-label {
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
.detail-value {
    color: #1e293b;
    word-break: break-word;
}
.detail-section-label {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
.conti-loading-hint {
    text-transform: none;
    font-weight: 400;
    font-style: italic;
    letter-spacing: normal;
    margin-left: 6px;
    font-size: 0.7rem;
}
.conti-section-loading { color: #b0b8c8; }
.conti-not-found {
    grid-column: 1 / -1;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.8rem;
    padding: 2px 0;
}
.conti-loading .conti-loading-bar {
    display: block;
    width: 70%;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: contiShimmer 1.5s ease-in-out infinite;
}
@keyframes contiShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (max-width: 700px) {
    .detail-grid { grid-template-columns: 1fr; gap: 2px 0; }
    .detail-label { font-size: 0.75rem; }
    .detail-content { padding: 12px 16px 12px 20px; }
}

/* -- Updated Row Highlight -- */
tr[data-updated] {
    background: rgba(162,198,41,0.14) !important;
    position: relative;
}
tr[data-updated] td {
    color: var(--navy);
    font-weight: 600;
}
tr[data-updated]::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--green);
}
tr[data-updated]:hover {
    background: rgba(162,198,41,0.22) !important;
}
tr[data-updated] td:first-child {
    padding-left: 16px;
}
/* aktualisiert: yellow-gold highlight (harmonizes with brand green) */
tr[data-updated="aktualisiert"] {
    background: rgba(234,179,8,0.18) !important;
}
tr[data-updated="aktualisiert"]::after {
    background: #eab308;
}
tr[data-updated="aktualisiert"]:hover {
    background: rgba(234,179,8,0.28) !important;
}

/* -- Empty / No Results -- */
.no-results {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
    display: none;
}
.no-results svg {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
    opacity: 0.35;
}
.no-results p {
    font-size: 0.85rem;
}

/* -- Loading -- */
.loading {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -- Skeleton Loading -- */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skel {
    background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 50%, var(--border) 75%);
    background-size: 400px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton content wrapper */
.skel-content { display: block; }

/* Skeleton filter pills */
.skel-pill {
    display: inline-block;
    height: 32px;
    border-radius: 16px;
}

/* Skeleton table rows */
.skel-row {
    display: flex;
    gap: 16px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
}
.skel-row:nth-child(odd) { background: #fafbfc; }
.skel-td {
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* Skeleton table header */
.skel-thead {
    background: var(--navy);
    padding: 10px 14px;
    display: flex;
    gap: 16px;
}
.skel-th {
    height: 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    flex-shrink: 0;
}

/* Hide real content until loaded */
.main:not(.loaded) .stats-grid .stat-value,
.main:not(.loaded) .stats-grid .stat-detail,
.main:not(.loaded) .stats-grid .stat-label { display: none; }

/* Skeleton elements hidden after load */
.main.loaded .skel-content { display: none; }

/* Fade-in transition */
.main.loaded .stats-grid,
.main.loaded .country-filter,
.main.loaded .frachtraum-filter,
.main.loaded .table-card {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* -- Scraper Indicator -- */
.scraper-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(162,198,41,0.12);
    font-size: 0.7rem;
    color: var(--green);
    font-weight: 500;
    white-space: nowrap;
    animation: indicatorPulse 2s ease-in-out infinite;
}
.scraper-indicator.active { display: inline-flex; }
.scraper-indicator .scraper-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: dotPulse 1s ease-in-out infinite;
}
@keyframes indicatorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* -- Scraper Progress Bar -- */
.scraper-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(162,198,41,0.15);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.scraper-progress.active { opacity: 1; }
.scraper-progress-bar {
    height: 100%;
    background: var(--green);
    border-radius: 1px;
    animation: progressMove 2s ease-in-out infinite;
}
@keyframes progressMove {
    0% { width: 30%; margin-left: 0; }
    50% { width: 45%; margin-left: 30%; }
    100% { width: 30%; margin-left: 70%; }
}

/* -- Row Update Flash -- */
@keyframes rowFlash {
    0% { background-color: rgba(162,198,41,0.25); }
    100% { background-color: transparent; }
}
tr.data-row.row-updated {
    animation: rowFlash 1.5s ease-out;
}

/* -- Error Banner -- */
.error-banner {
    background: #fef2f2;
    color: #991b1b;
    padding: 14px 32px;
    font-size: 0.85rem;
    font-weight: 500;
    border-bottom: 2px solid #fca5a5;
    display: flex;
    align-items: center;
    gap: 10px;
}
.error-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* -- Footer -- */
.footer {
    text-align: center;
    padding: 28px 32px 20px;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.footer .hint {
    margin-top: 4px;
    font-size: 0.68rem;
    opacity: 0.6;
}

/* -- Animations -- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in {
    animation: fadeUp 0.35s ease-out both;
}
.stats-grid .stat-card:nth-child(1) { animation-delay: 0s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.06s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.12s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.18s; }
@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(162,198,41,0); }
    50% { box-shadow: 0 0 0 6px rgba(162,198,41,0.15); }
}
.stat-card.accent {
    animation: fadeUp 0.35s ease-out both, pulseGreen 2s ease-in-out 0.5s 2;
}

/* -- Dismiss -- */
@keyframes dismissError {
    0%, 100% { background-color: inherit; }
    50% { background-color: #fecaca; }
}
.dismiss-col {
    width: 56px; text-align: center; padding: 8px 10px !important;
    vertical-align: middle;
}
.dismiss-btn {
    padding: 6px 14px; border: none;
    border-radius: 8px; cursor: pointer;
    background: var(--green); color: var(--navy);
    font-size: 0.72rem; font-weight: 700; font-family: inherit;
    letter-spacing: 0.03em; transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap; line-height: 1;
    box-shadow: 0 1px 3px rgba(162,198,41,0.25);
    text-transform: uppercase;
}
.dismiss-btn:hover {
    background: var(--green-hover); color: var(--navy);
    box-shadow: 0 3px 12px rgba(162,198,41,0.35);
    transform: translateY(-1px);
}
.dismiss-btn:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 1px 2px rgba(162,198,41,0.2);
}

.dismiss-overlay {
    position: fixed; inset: 0;
    background: rgba(4,12,44,0.55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    animation: overlayIn 0.2s ease;
}
@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.dismiss-modal {
    background: #fff; border-radius: 14px;
    padding: 28px 32px 24px;
    box-shadow: 0 20px 60px rgba(4,12,44,0.3), 0 0 0 1px rgba(162,198,41,0.15);
    max-width: 340px; width: 90%;
    text-align: center; font-family: inherit;
    animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.dismiss-modal .modal-icon {
    width: 40px; height: 40px; margin: 0 auto 14px;
    background: rgba(162,198,41,0.12);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.dismiss-modal .modal-icon svg {
    width: 20px; height: 20px; color: var(--green);
}
.dismiss-modal p {
    margin: 0 0 6px; font-size: 0.95rem;
    color: var(--navy); font-weight: 600;
}
.dismiss-modal .modal-sub {
    margin: 0 0 20px; font-size: 0.8rem;
    color: #64748b;
}
.dismiss-modal .btn-row {
    display: flex; gap: 10px; justify-content: center;
}
.dismiss-modal button {
    padding: 9px 24px; border: none; border-radius: 8px;
    font-size: 0.82rem; cursor: pointer; font-weight: 600;
    transition: all 0.15s ease; letter-spacing: 0.01em;
}
.dismiss-modal .btn-cancel {
    background: #f1f5f9; color: #475569;
    border: 1px solid #e2e8f0;
}
.dismiss-modal .btn-cancel:hover {
    background: #e2e8f0;
}
.dismiss-modal .btn-confirm {
    background: var(--green); color: var(--navy);
}
.dismiss-modal .btn-confirm:hover {
    background: var(--green-hover);
    box-shadow: 0 4px 12px rgba(162,198,41,0.35);
}

/* -- Connection Status Dot -- */
.connection-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    vertical-align: middle;
    margin-right: 4px;
    transition: background 0.3s ease;
}
.connection-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}
.connection-dot.connecting {
    background: #eab308;
    animation: dotPulse 1.5s ease-in-out infinite;
}
.connection-dot.disconnected {
    background: #ef4444;
}
.connection-dot.refreshing {
    background: #3b82f6;
    animation: dotPulse 1s ease-in-out infinite;
}
@keyframes dotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.relative-time {
    color: rgba(255,255,255,0.35);
    font-size: 0.65rem;
}

/* -- Responsive -- */
@media (max-width: 768px) {
    body::before { height: 2px; }
    .topnav { padding: 0 16px; height: 64px; top: 2px; }
    .topnav-logo { height: 28px; }
    .topnav-meta { display: none; }
    .nav-links { gap: 2px; margin-left: 4px; }
    .nav-link { padding: 5px 10px; font-size: 0.75rem; }
    .nav-link svg { width: 14px; height: 14px; }
    .main { padding: 16px 16px 32px; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }
    .stat-card { padding: 14px 16px; }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: 0.65rem; }
    .search-fab { bottom: 20px; right: 20px; }
    .search-fab-btn { width: 50px; height: 50px; }
    .search-panel { height: 50px; width: 50px; padding-right: 50px; }
    th, td { padding: 6px 6px; font-size: 0.65rem; }
    .footer { padding: 20px 16px 16px; }
}
@media (max-width: 640px) {
    .topnav { padding: 0 12px; }
    .topnav-right { gap: 8px; }
    .topnav-left { gap: 12px; }
    /* Collapse text buttons to icon-only (label spans go to 0) */
    .logout-btn {
        padding: 6px 8px;
        gap: 0;
        font-size: 0;
    }
    .logout-btn svg { width: 18px; height: 18px; }
    /* Scraper indicator: shrink text */
    .scraper-indicator {
        padding: 4px 8px;
        font-size: 0;
        gap: 0;
    }
    .scraper-indicator .scraper-dot { width: 7px; height: 7px; }
    .nav-link { padding: 5px 8px; }
}
@media (max-width: 480px) {
    .topnav { padding: 0 10px; height: 60px; }
    .topnav-logo { height: 26px; }
    .topnav-sep { display: none; }
    .topnav-left { gap: 10px; margin-right: 6px; }
    .topnav-right { gap: 6px; }
    .topnav-title { font-size: 0.8rem; }
    /* Hide nav-link label, keep only icon */
    .nav-link { padding: 5px 6px; font-size: 0; gap: 0; }
    .nav-link svg { width: 15px; height: 15px; }
    /* Smaller toggle buttons */
    .notif-toggle, .sound-toggle { width: 30px; height: 30px; }
    .notif-toggle svg, .sound-toggle svg { width: 16px; height: 16px; }
    .stats-grid { gap: 8px; }
    .stat-card { padding: 12px 12px; }
    .stat-value { font-size: 1.25rem; }
    .stat-detail { font-size: 0.62rem; }
    /* Frachtraum row: select takes own line */
    .frachtraum-filter select { flex: 1 1 100%; }
    .search-fab { bottom: 14px; right: 14px; }
    .search-fab-btn { width: 46px; height: 46px; }
    .search-panel { height: 46px; width: 46px; padding-right: 46px; }
    .footer { padding: 16px 12px 12px; font-size: 0.75rem; }
    .footer .hint { display: none; }
}
@media (max-width: 360px) {
    /* Very small phones: stats single column */
    .stats-grid { grid-template-columns: 1fr; }
}

/* -- Context Menu -- */
.context-menu {
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(4,12,44,0.18), 0 0 0 1px rgba(0,0,0,0.06);
    padding: 4px;
    z-index: 10000;
    min-width: 180px;
    animation: modalIn 0.15s ease;
}
.context-menu-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.82rem;
    color: var(--navy);
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
}
.context-menu-item:hover {
    background: #f1f5f9;
}

/* -- History Modal -- */
.history-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(4,12,44,0.3), 0 0 0 1px rgba(0,0,0,0.06);
    max-width: 440px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
    font-family: inherit;
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 14px;
    border-bottom: 1px solid #e2e8f0;
}
.history-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--navy);
    font-weight: 600;
}
.history-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.history-close:hover { color: var(--navy); }
.history-body {
    padding: 16px 24px 20px;
    overflow-y: auto;
    flex: 1;
}
.history-loading, .history-empty, .history-error {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    padding: 20px 0;
}
.history-error { color: #dc2626; }

/* Timeline entries */
.history-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.timeline-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.timeline-entry:last-child { border-bottom: none; }
.timeline-time {
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
    margin-left: 12px;
}

/* Timestamp columns */
.col-timestamp {
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
}

/* -- Login overlays / panel controls (shared by Benutzer & Aktivitäten) -- */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4,12,44,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    width: 340px;
    box-shadow: var(--shadow-md);
}
.admin-login-box h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}
.admin-login-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
}
.admin-login-box input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(162,198,41,0.15);
}
.admin-login-error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 12px;
}
.admin-login-actions {
    display: flex;
    gap: 8px;
}
.admin-btn-primary {
    flex: 1;
    padding: 10px 16px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.admin-btn-primary:hover { background: var(--navy-light); }
.admin-btn-secondary {
    padding: 10px 16px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.admin-btn-secondary:hover { background: var(--border-light); }
.admin-panel-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.admin-panel-header h2 {
    font-size: 18px;
    font-weight: 600;
}
.admin-panel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-panel-controls select,
.admin-panel-controls input[type="text"] {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    background: var(--white);
}
.admin-panel-controls select:focus,
.admin-panel-controls input[type="text"]:focus {
    outline: none;
    border-color: var(--green);
}
/* --- Auth login overlay --- */
.auth-login-overlay {
    position: fixed;
    inset: 0;
    background: var(--navy, #040c2c);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 36px 32px;
    width: 340px;
    box-shadow: var(--shadow-md);
    text-align: center;
}
.auth-login-box .auth-logo {
    height: 40px;
    margin-bottom: 18px;
}
.auth-login-box h3 {
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 600;
}
.auth-login-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
}
.auth-login-box input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(162,198,41,0.15);
}

/* --- Data panels (Benutzer / Aktivitäten) --- */
.data-panel {
    position: fixed;
    inset: 83px 0 0 0;
    background: var(--white);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 28px;
}
.card-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 56px 20px;
}

/* Benutzer — card grid */
.user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
    max-width: 1120px;
    margin: 0 auto;
}
.user-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow:
        0 1px 2px rgba(4,12,44,0.03),
        0 1px 10px rgba(4,12,44,0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: box-shadow 0.16s, transform 0.16s, border-color 0.16s;
}
.user-card:hover {
    box-shadow:
        0 2px 4px rgba(4,12,44,0.04),
        0 10px 24px rgba(4,12,44,0.08);
    border-color: rgba(4,12,44,0.10);
    transform: translateY(-2px);
}
.user-card.is-inactive { opacity: 0.6; }
.user-card-top {
    display: flex;
    align-items: center;
    gap: 13px;
}
.user-avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--green-medium);
    color: var(--navy);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-card.is-inactive .user-avatar {
    background: var(--border-light);
    color: var(--text-muted);
}
.user-id { flex: 1; min-width: 0; }
.user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-handle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 1px;
}
.user-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 12px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}
.user-created {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.user-actions { display: flex; gap: 7px; flex-shrink: 0; }
.status-pill {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    background: var(--green-medium);
    color: #5f7800;
}
.status-pill.inactive {
    background: var(--border-light);
    color: var(--text-muted);
}
.card-action {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 13px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--text);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.card-action:hover { background: var(--bg); border-color: var(--text-muted); }
.card-action-danger:hover {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.45);
    color: #dc2626;
}

/* Data-Panels (Aktivitäten + Benutzer) — Backdrop & Surface */
#activityPanel .card-scroll,
#usersPanel .card-scroll {
    background: var(--bg);
    padding: 26px 24px 36px;
}
#activityPanel .admin-panel-header,
#usersPanel .admin-panel-header,
#activityPanel .activity-filterbar {
    background: var(--white);
}

/* Header — editorial, mehr Atem */
#activityPanel .admin-panel-header,
#usersPanel .admin-panel-header {
    padding: 26px 32px 22px;
    column-gap: 24px;
    row-gap: 16px;
    align-items: flex-end;
}
/* Activity hat die Filterbar als Trennung — keine Border am Header */
#activityPanel .admin-panel-header { border-bottom: none; }
/* User-Panel ohne Filterbar → dezente Border als Trennung zum Backdrop */
#usersPanel .admin-panel-header { border-bottom: 1px solid var(--border-light); }

#activityPanel .admin-panel-header h2,
#usersPanel .admin-panel-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.15;
    position: relative;
    padding-left: 14px;
}
#activityPanel .admin-panel-header h2::before,
#usersPanel .admin-panel-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 4px;
    width: 3px;
    border-radius: 2px;
    background: var(--green);
}

#activityPanel .admin-panel-controls,
#usersPanel .admin-panel-controls {
    gap: 10px;
}

/* Select (nur Activity hat ein select) */
#activityPanel .admin-panel-controls select {
    padding: 8px 30px 8px 12px;
    font-size: 13px;
    color: var(--text);
    background-color: var(--white);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 14px) 50%,
        calc(100% - 10px) 50%;
    background-size: 4px 4px, 4px 4px;
    background-repeat: no-repeat;
    appearance: none;
    -webkit-appearance: none;
    min-width: 180px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
#activityPanel .admin-panel-controls select:hover {
    border-color: var(--text-muted);
}
#activityPanel .admin-panel-controls select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(4,12,44,0.08);
}

/* Sekundäre Buttons (Aktualisieren / Schließen / Abbrechen) */
#activityPanel .admin-panel-controls .admin-btn-secondary,
#usersPanel .admin-panel-controls .admin-btn-secondary {
    padding: 8px 16px;
    font-size: 13px;
    background: var(--white);
    border-color: var(--border);
    transition: background 0.18s ease, border-color 0.18s ease,
                color 0.18s ease;
}
#activityPanel .admin-panel-controls .admin-btn-secondary:hover,
#usersPanel .admin-panel-controls .admin-btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
    color: var(--text);
}

/* Primärer Button (Neuer Benutzer) — auf Header-Skalierung angepasst */
#usersPanel .admin-panel-controls .admin-btn-primary {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(4,12,44,0.06);
    transition: background 0.18s ease, box-shadow 0.18s ease,
                transform 0.18s ease;
}
#usersPanel .admin-panel-controls .admin-btn-primary:hover {
    box-shadow: 0 2px 6px rgba(4,12,44,0.12);
    transform: translateY(-1px);
}

/* Filterbar: leicht ruhiger und mit oberem Padding für Trennung zum Header */
#activityPanel .activity-filterbar {
    padding: 14px 32px 18px;
    border-bottom: 1px solid var(--border-light);
}

/* Aktivitäten — editorial timeline ledger */
.activity-feed {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.activity-feed::before {
    content: '';
    position: absolute;
    left: 27px;
    top: 18px;
    bottom: 18px;
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(4,12,44,0.10) 6%,
        rgba(4,12,44,0.10) 94%,
        transparent 100%);
    pointer-events: none;
}
.activity-item {
    --accent: var(--text-muted);
    --badge-bg: var(--bg);
    --badge-fg: var(--text-secondary);
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: start;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 18px 14px 10px;
    box-shadow:
        0 1px 2px rgba(4,12,44,0.03),
        0 1px 10px rgba(4,12,44,0.04);
    position: relative;
    transition: box-shadow 0.18s ease, transform 0.18s ease,
                border-color 0.18s ease;
}
.activity-item::after {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
    opacity: 0;
    transform: scaleY(0.5);
    transform-origin: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.activity-item:hover {
    box-shadow:
        0 2px 4px rgba(4,12,44,0.04),
        0 10px 24px rgba(4,12,44,0.08);
    transform: translateY(-1px);
    border-color: rgba(4,12,44,0.10);
}
.activity-item:hover::after { opacity: 0.85; transform: scaleY(1); }

.activity-badge {
    width: 32px;
    height: 32px;
    margin: 2px 0 0 6px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--badge-bg);
    color: var(--badge-fg);
    box-shadow: 0 0 0 4px var(--white);
    position: relative;
    z-index: 1;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.activity-badge svg { width: 15px; height: 15px; display: block; }
.activity-item:hover .activity-badge {
    transform: scale(1.06);
}

.act-ok     { --accent: var(--green);
              --badge-bg: var(--green-medium);
              --badge-fg: #5f7800; }
.act-info   { --accent: var(--navy);
              --badge-bg: rgba(4,12,44,0.08);
              --badge-fg: var(--navy); }
.act-danger { --accent: #ef4444;
              --badge-bg: rgba(239,68,68,0.10);
              --badge-fg: #b91c1c; }
.act-muted  { --accent: var(--text-muted);
              --badge-bg: var(--bg);
              --badge-fg: var(--text-secondary); }

.activity-body { min-width: 0; }
.activity-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 14px;
    flex-wrap: wrap;
}
.activity-head {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    flex: 1 1 auto;
}
.activity-action {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-by {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity-by .activity-user {
    color: var(--text-secondary);
    font-weight: 500;
}
.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.01em;
    cursor: default;
}
.activity-detail {
    margin-top: 7px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.55;
    word-break: break-word;
    padding-left: 11px;
    border-left: 2px solid var(--border-light);
}

/* Aktivitäten — action filter */
.activity-filterbar {
    display: flex;
    gap: 8px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    scrollbar-width: none;
}
.activity-filterbar::-webkit-scrollbar { display: none; }
.filter-pill {
    flex-shrink: 0;
    padding: 6px 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--white);
    font-family: 'Jost', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.filter-pill:hover {
    border-color: var(--green);
    color: var(--text);
}
.filter-pill.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* --- Data panels: responsive --- */
@media (max-width: 768px) {
    .data-panel { inset: 66px 0 0 0; }
    .admin-panel-header { padding: 14px 16px; }
    .admin-panel-controls { width: 100%; }
    .admin-panel-controls select,
    .admin-panel-controls .admin-btn-primary,
    .admin-panel-controls .admin-btn-secondary { flex: 1; }
    .card-scroll { padding: 16px 14px 24px; }
    .activity-filterbar { padding: 10px 14px; }
    .user-grid { grid-template-columns: 1fr; gap: 12px; }
    .activity-feed::before { display: none; }
    .activity-item {
        grid-template-columns: 36px 1fr;
        gap: 12px;
        padding: 12px 14px 12px 10px;
    }
    .activity-badge {
        width: 28px;
        height: 28px;
        margin: 1px 0 0 0;
        box-shadow: none;
    }
    .activity-badge svg { width: 13px; height: 13px; }
    .activity-action { font-size: 13.5px; }
    .activity-by { font-size: 12.5px; }
    .activity-time {
        font-size: 11.5px;
        order: 3;
        flex-basis: 100%;
        margin-top: 2px;
    }
    .activity-detail { font-size: 12.5px; padding-left: 9px; }
}
