/* ================================================================
   ADMIN: VERSANDSTELLEN v3.0.0
   State-of-the-Art Glassmorphism · Kaufland Dark Theme

   Datei: fe-auslastungsmonitor/assets/versandstellen.css
   Wird von Dash automatisch geladen.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;600&display=swap');


/* ================================================================
   CSS CUSTOM PROPERTIES
   ================================================================ */
:root {
    /* Kaufland Brand */
    --vs-accent:        #E00000;
    --vs-accent-rgb:    224, 0, 0;
    --vs-accent-glow:   rgba(224, 0, 0, 0.25);
    --vs-accent-subtle: rgba(224, 0, 0, 0.08);

    /* Status: Grün */
    --vs-green:         #10b981;
    --vs-green-rgb:     16, 185, 129;
    --vs-green-glow:    rgba(16, 185, 129, 0.18);
    --vs-green-subtle:  rgba(16, 185, 129, 0.08);

    /* Backgrounds */
    --vs-bg-page:       #1a1a1a;
    --vs-bg-card:       rgba(255, 255, 255, 0.03);
    --vs-bg-card-active:rgba(255, 255, 255, 0.055);
    --vs-bg-card-hover: rgba(255, 255, 255, 0.075);

    /* Borders */
    --vs-border:        rgba(255, 255, 255, 0.07);
    --vs-border-active: rgba(255, 255, 255, 0.12);
    --vs-border-red:    rgba(224, 0, 0, 0.18);

    /* Typography */
    --vs-text-primary:   #f0f1f5;
    --vs-text-secondary: rgba(255, 255, 255, 0.55);
    --vs-text-muted:     rgba(255, 255, 255, 0.28);

    /* Shadows */
    --vs-shadow-card:    0 2px 8px rgba(0, 0, 0, 0.25);
    --vs-shadow-active:  0 4px 24px rgba(0, 0, 0, 0.35),
                         0 0 0 1px rgba(255, 255, 255, 0.06);
    --vs-shadow-hover:   0 8px 32px rgba(0, 0, 0, 0.45),
                         0 0 0 1px rgba(255, 255, 255, 0.09);

    /* Fonts */
    --vs-font:      'DM Sans', -apple-system, 'Segoe UI', system-ui, sans-serif;
    --vs-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    /* Transitions */
    --vs-ease:    cubic-bezier(0.22, 1, 0.36, 1);
    --vs-ease-in: cubic-bezier(0.4, 0, 1, 1);
}

[data-mantine-color-scheme="light"] {
    --vs-bg-page:        #f4f4f6;
    --vs-bg-card:        rgba(255, 255, 255, 0.65);
    --vs-bg-card-active: rgba(255, 255, 255, 0.9);
    --vs-bg-card-hover:  rgba(255, 255, 255, 0.95);
    --vs-border:         rgba(0, 0, 0, 0.07);
    --vs-border-active:  rgba(0, 0, 0, 0.11);
    --vs-text-primary:   #0d0d0d;
    --vs-text-secondary: rgba(0, 0, 0, 0.5);
    --vs-text-muted:     rgba(0, 0, 0, 0.28);
    --vs-shadow-card:    0 2px 8px rgba(0, 0, 0, 0.06);
    --vs-shadow-active:  0 4px 16px rgba(0, 0, 0, 0.1);
    --vs-shadow-hover:   0 8px 24px rgba(0, 0, 0, 0.12);
    --vs-green-glow:     rgba(16, 185, 129, 0.12);
    --vs-green-subtle:   rgba(16, 185, 129, 0.06);
}


/* ================================================================
   ANIMATIONS
   ================================================================ */

/* Card reveal */
@keyframes vsFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Left accent glow (active state) */
@keyframes vsAccentPulse {
    0%, 100% { opacity: 0.7; box-shadow: 0 0 6px 0 var(--vs-green-glow); }
    50%      { opacity: 1;   box-shadow: 0 0 18px 3px var(--vs-green-glow); }
}

/* Pulsing dot animation */
@keyframes vsDotPulse {
    0%   { transform: scale(1);   opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50%  { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
    100% { transform: scale(1);   opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Progress bar fill shimmer */
@keyframes vsShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* Page load */
@keyframes vsBarReveal {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ================================================================
   PAGE
   ================================================================ */
.vs-page {
    font-family: var(--vs-font);
    padding-top: 48px;
    padding-bottom: 80px;
    min-height: 60vh;
    position: relative;
}

/* Subtle noise texture */
.vs-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.012;
    pointer-events: none;
    z-index: 0;
}


/* ================================================================
   TOP BAR (Breadcrumb + Counter)
   ================================================================ */
.vs-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    animation: vsFadeUp 0.4s var(--vs-ease) both;
}

.vs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.vs-breadcrumb-link {
    color: var(--vs-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.vs-breadcrumb-link:hover { color: var(--vs-accent); }

.vs-breadcrumb-sep     { color: var(--vs-text-muted); opacity: 0.4; }
.vs-breadcrumb-current { color: var(--vs-text-secondary); }

.vs-counter       { font-size: 13px; }
.vs-counter-num   { font-family: var(--vs-font-mono); font-weight: 600; color: var(--vs-green); }
.vs-counter-label { color: var(--vs-text-muted); }


/* ================================================================
   PAGE HEADER
   ================================================================ */
.vs-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    animation: vsFadeUp 0.4s var(--vs-ease) 0.08s both;
}

.vs-page-title {
    font-family: var(--vs-font);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--vs-text-primary);
    margin: 0;
}

.vs-page-sub {
    font-size: 14px;
    color: var(--vs-text-muted);
    margin: 6px 0 0;
    max-width: 480px;
    line-height: 1.5;
}

.vs-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--vs-border);
    background: var(--vs-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--vs-text-secondary);
    font-size: 13px;
    font-family: var(--vs-font);
    cursor: pointer;
    transition: all 0.2s ease;
}
.vs-back-btn:hover {
    border-color: rgba(var(--vs-accent-rgb), 0.3);
    color: var(--vs-accent);
    background: rgba(var(--vs-accent-rgb), 0.04);
}


/* ================================================================
   STATUS / PROGRESS BAR
   ================================================================ */
.vs-progress-wrapper {
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
    animation: vsBarReveal 0.5s var(--vs-ease) 0.15s both;
}

.vs-status-bar {
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 12px;
    padding: 16px 20px;
}

.vs-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vs-bar-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--vs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.vs-bar-count {
    font-family: var(--vs-font-mono);
    font-size: 13px;
}
.vs-bar-count-active {
    font-weight: 700;
    font-size: 15px;
}
.vs-bar-count-total {
    color: var(--vs-text-muted);
    font-size: 13px;
}

.vs-bar-track {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

/* Tick marks layered on top of track */
.vs-bar-ticks {
    position: relative;
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 1px;
}

.vs-bar-tick {
    width: 1px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
}


/* ================================================================
   CARD GRID
   ================================================================ */
.vs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
    z-index: 1;
}


/* ================================================================
   CARD BASE
   ================================================================ */
.vs-card {
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--vs-border);
    background: var(--vs-bg-card);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    overflow: hidden;
    box-shadow: var(--vs-shadow-card);
    transition:
        transform      0.3s var(--vs-ease),
        box-shadow     0.3s var(--vs-ease),
        border-color   0.3s ease,
        background     0.3s ease,
        opacity        0.3s ease;
    animation: vsFadeUp 0.5s var(--vs-ease) both;
    cursor: default;
}

/* Stagger delays */
.vs-card-0  { animation-delay: 0.10s; }
.vs-card-1  { animation-delay: 0.14s; }
.vs-card-2  { animation-delay: 0.18s; }
.vs-card-3  { animation-delay: 0.22s; }
.vs-card-4  { animation-delay: 0.26s; }
.vs-card-5  { animation-delay: 0.30s; }
.vs-card-6  { animation-delay: 0.34s; }
.vs-card-7  { animation-delay: 0.38s; }
.vs-card-8  { animation-delay: 0.42s; }
.vs-card-9  { animation-delay: 0.46s; }
.vs-card-10 { animation-delay: 0.50s; }
.vs-card-11 { animation-delay: 0.54s; }

/* Hover: scale up + deepen shadow */
.vs-card:hover {
    transform:    translateY(-3px) scale(1.012);
    box-shadow:   var(--vs-shadow-hover);
    border-color: var(--vs-border-active);
    background:   var(--vs-bg-card-hover);
}

/* Active card */
.vs-card-active {
    background:   var(--vs-bg-card-active);
    border-color: var(--vs-border-active);
    box-shadow:   var(--vs-shadow-active);
}

/* Inactive card — dimmed */
.vs-card-inactive {
    opacity: 0.6;
}
.vs-card-inactive:hover {
    opacity: 1;
}


/* ================================================================
   LEFT ACCENT STRIPE
   ================================================================ */
.vs-card-accent {
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: all 0.35s ease;
}

.vs-card-active .vs-card-accent {
    background: var(--vs-green);
    animation: vsAccentPulse 3s ease-in-out infinite;
}


/* ================================================================
   CARD CONTENT
   ================================================================ */
.vs-card-content {
    padding: 18px 18px 16px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Top row: icon + text + pulse dot */
.vs-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vs-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.vs-card-active .vs-card-icon,
.vs-icon-active {
    background: var(--vs-accent-subtle) !important;
    border-color: var(--vs-border-red) !important;
}

.vs-card-nr {
    font-family: var(--vs-font-mono);
    font-size: 15px;
    font-weight: 600;
    color: var(--vs-text-primary);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.vs-card-name {
    font-size: 12px;
    color: var(--vs-text-muted);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    line-height: 1.3;
}


/* ================================================================
   PULSING GLOW DOT (aktiv = grün pulsierend)
   ================================================================ */
.vs-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--vs-green);
    flex-shrink: 0;
    animation: vsDotPulse 2.2s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(var(--vs-green-rgb), 0.5);
    transition: opacity 0.3s ease;
}

.vs-dot-hidden {
    background: rgba(255, 255, 255, 0.12);
    animation: none;
    opacity: 0.4;
}


/* ================================================================
   BOTTOM ROW: Status Label + Toggle
   ================================================================ */
.vs-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}

.vs-card-status-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 3px 9px;
    border-radius: 5px;
    transition: all 0.25s ease;
}

.vs-status-active {
    color: var(--vs-green);
    background: var(--vs-green-subtle);
}

.vs-status-inactive {
    color: var(--vs-text-muted);
    background: transparent;
}

/* Mantine Switch: Kaufland-Rot im checked State */
.vs-toggle .mantine-Switch-track {
    border-color: var(--vs-border) !important;
    transition: background 0.2s, border-color 0.2s !important;
}
.vs-toggle .mantine-Switch-track[data-checked] {
    background:   var(--vs-accent) !important;
    border-color: var(--vs-accent) !important;
    box-shadow:   0 0 8px rgba(var(--vs-accent-rgb), 0.4);
}


/* ================================================================
   EMPTY STATE
   ================================================================ */
.vs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    grid-column: 1 / -1;
    animation: vsFadeUp 0.5s var(--vs-ease) 0.2s both;
}

.vs-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--vs-bg-card);
    border: 1px solid var(--vs-border);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.vs-empty-text {
    font-size: 14px;
    color: var(--vs-text-secondary);
}


/* ================================================================
   RESPONSIVE — 4K+
   ================================================================ */
@media (min-width: 1600px) {
    .vs-page          { padding-top: 56px; }
    .vs-page-title    { font-size: 32px; }
    .vs-grid          { gap: 16px; }
    .vs-card-content  { padding: 22px 22px 18px 26px; }
    .vs-card-icon     { width: 46px; height: 46px; }
}


/* ================================================================
   RESPONSIVE — Tablet (≤ 960px)
   ================================================================ */
@media (max-width: 960px) {
    .vs-grid        { grid-template-columns: repeat(2, 1fr); }
    .vs-page        { padding-top: 36px; }
    .vs-page-title  { font-size: 24px; }
}


/* ================================================================
   RESPONSIVE — Mobile (≤ 680px)
   ================================================================ */
@media (max-width: 680px) {
    .vs-grid { grid-template-columns: 1fr; }

    .vs-page {
        padding-top:    28px;
        padding-bottom: 48px;
    }

    .vs-page-title { font-size: 22px; }

    .vs-page-header {
        flex-direction:  column;
        align-items:     flex-start;
    }

    .vs-top-bar {
        flex-direction: column;
        align-items:    flex-start;
        gap:            12px;
    }

    .vs-card-name { max-width: 140px; }
}


/* ================================================================
   RESPONSIVE — Phone (≤ 420px)
   ================================================================ */
@media (max-width: 420px) {
    .vs-card-content  { padding: 14px 14px 12px 18px; }
    .vs-card-icon     { width: 36px; height: 36px; border-radius: 9px; }
    .vs-card-nr       { font-size: 14px; }
    .vs-card-status-label { display: none; }
    .vs-bar-label     { display: none; }
}