/* ============================================================
   VLYX Briefing – Theme im Look & Feel des VLYX Navigators
   Wird NACH allen anderen Stylesheets geladen und überschreibt
   gezielt das Layout-Chrome (Sidebar, Topbar, Bottom-Nav),
   sowie Brand-Tokens.
   ============================================================ */

/* ===== VLYX Designtokens — gespiegelt aus dem Navigator ===== */
:root {
    --vlyx-primary:           #2563eb;
    --vlyx-primary-dark:      #1d4ed8;
    --vlyx-primary-light:     #dbeafe;
    --vlyx-sidebar-bg:        #1e293b;
    --vlyx-sidebar-hover:     #334155;
    --vlyx-sidebar-text:      #cbd5e1;
    --vlyx-sidebar-text-active: #ffffff;
    --vlyx-sidebar-border:    rgba(255, 255, 255, 0.1);
    --vlyx-sidebar-brand:     #ffffff;
    --vlyx-sidebar-width:     260px;
    --vlyx-topbar-height:     56px;
    --vlyx-topbar-bg:         #ffffff;
    --vlyx-content-bg:        #f1f5f9;
    --vlyx-card-bg:           #ffffff;
    --vlyx-border:            #e2e8f0;
    --vlyx-text:              #1e293b;
    --vlyx-text-muted:        #64748b;
    --vlyx-success:           #16a34a;
    --vlyx-warning:           #d97706;
    --vlyx-danger:            #dc2626;
    --vlyx-info:              #0891b2;
    --vlyx-font-family:       'Inter', 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Eigene Tokens auf VLYX angleichen, sodass bestehende Templates passen */
    --color-bg:               var(--vlyx-content-bg);
    --color-text:             var(--vlyx-text);
    --color-text-secondary:   var(--vlyx-text-muted);
    --color-border:           var(--vlyx-border);
    --color-primary:          var(--vlyx-primary);
    --color-primary-hover:    var(--vlyx-primary-dark);
    --color-primary-light:    var(--vlyx-primary-light);
    --color-success:          var(--vlyx-success);
    --color-warning:          var(--vlyx-warning);
    --color-danger:           var(--vlyx-danger);
    --font-sans:              var(--vlyx-font-family);
    --sidebar-width:          var(--vlyx-sidebar-width);
    --header-height:          var(--vlyx-topbar-height);
}

/* ===== Body / Basis ===== */
body.app-body {
    font-family: var(--vlyx-font-family);
    background: var(--vlyx-content-bg);
    color: var(--vlyx-text);
    font-size: 0.9rem;
}

/* ===== Layout-Wrapper ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-main {
    margin-left: var(--vlyx-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-content {
    padding: 1.5rem;
    flex: 1;
}

/* ===== Sidebar (dunkel, VLYX-Stil) ===== */
.app-sidebar {
    width: var(--vlyx-sidebar-width);
    background: var(--vlyx-sidebar-bg);
    color: var(--vlyx-sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--vlyx-sidebar-border);
}

.sidebar-brand {
    color: var(--vlyx-sidebar-brand);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand:hover {
    color: var(--vlyx-sidebar-brand);
}

.sidebar-brand img {
    border-radius: 6px;
    display: block;
}

.sidebar-brand-product {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.9rem;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--vlyx-sidebar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--vlyx-sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav-item:hover {
    background: var(--vlyx-sidebar-hover);
    color: var(--vlyx-sidebar-text-active);
}

.sidebar-nav-item.active {
    background: var(--vlyx-sidebar-hover);
    color: var(--vlyx-sidebar-text-active);
    border-left-color: var(--vlyx-primary);
    font-weight: 500;
}

.sidebar-nav-item i {
    font-size: 1.15rem;
    width: 1.25rem;
    text-align: center;
}

.sidebar-divider {
    border-top: 1px solid var(--vlyx-sidebar-border);
    margin: 0.5rem 1.25rem;
}

.sidebar-section-label {
    padding: 0.4rem 1.25rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--vlyx-sidebar-text);
    opacity: 0.5;
    user-select: none;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--vlyx-sidebar-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--vlyx-sidebar-text);
    font-size: 0.85rem;
}

.sidebar-user i {
    font-size: 1.25rem;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
}
.sidebar-overlay.show {
    display: block;
}

/* ===== Topbar ===== */
.app-topbar {
    height: var(--vlyx-topbar-height);
    background: var(--vlyx-topbar-bg);
    border-bottom: 1px solid var(--vlyx-border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--vlyx-text);
    cursor: pointer;
    padding: 0.25rem;
    margin-right: 0.75rem;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--vlyx-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

.topbar-breadcrumb-link {
    color: var(--vlyx-primary);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar-breadcrumb-link:hover {
    color: var(--vlyx-primary-dark);
    text-decoration: underline;
}

.topbar-breadcrumb-sep {
    color: var(--vlyx-text-muted);
    font-size: 0.7rem;
    margin: 0 0.4rem;
    flex-shrink: 0;
}

.topbar-breadcrumb-current {
    color: var(--vlyx-text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.topbar-actions {
    margin-left: auto;
}

.topbar-actions .btn-link {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--vlyx-text);
}

/* ===== Mobile Bottom-Nav ===== */
.app-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--vlyx-border);
    display: flex;
    justify-content: space-around;
    padding: 0.4rem 0 calc(0.4rem + env(safe-area-inset-bottom, 0px));
    z-index: 1040;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    color: var(--vlyx-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    transition: color 0.15s;
}

.mobile-nav-item i {
    font-size: 1.25rem;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
    color: var(--vlyx-primary);
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
    .app-content {
        padding: 1rem;
        padding-bottom: 5rem;
    }
}

@media (min-width: 768px) {
    .app-mobile-nav {
        display: none !important;
    }
}

/* ===== Bootstrap-Overrides für Konsistenz ===== */

/* Bootstrap-Reset entschärfen wo es mit eigenen Klassen kollidiert */
.app-body .card {
    border: 1px solid var(--vlyx-border);
    border-radius: 0.5rem;
}

/* Buttons: VLYX-Primary-Farbe für Bootstrap-Klassen */
.btn-primary {
    background-color: var(--vlyx-primary);
    border-color: var(--vlyx-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--vlyx-primary-dark);
    border-color: var(--vlyx-primary-dark);
}

/* Login/Guest-Layout */
.app-content-guest {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 1rem;
}

.app-content-guest .auth-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.app-content-guest .auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.app-content-guest .auth-brand img {
    border-radius: 12px;
}

.app-content-guest .auth-brand .brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--vlyx-text);
}

.app-content-guest .auth-brand .brand-product {
    font-size: 0.9rem;
    color: var(--vlyx-text-muted);
}
