/* ===== SIDEBAR — Magento-style icon strip + flyout ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: row;
}

/* ===== ICON STRIP (always visible) ===== */
.sidebar-strip {
    width: 68px;
    background: #242424;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Brand icon at top */
.sidebar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid #333;
    text-decoration: none;
}

.sidebar-logo-sm {
    height: 28px;
    width: auto;
}

.brand-icon-fallback {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--brand-primary, #4CAF50);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Strip navigation */
.strip-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 8px 0;
    gap: 2px;
}

/* Each strip item — icon + small label */
.strip-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 60px;
    padding: 10px 4px 8px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    color: #999;
}

.strip-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.strip-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.strip-item.active .strip-icon {
    color: var(--brand-primary, #4CAF50);
}

.strip-item.flyout-open {
    background: var(--brand-primary, #4CAF50);
    color: #fff;
}

.strip-item.flyout-open .strip-icon {
    color: #fff;
}

.strip-item.flyout-open .strip-label {
    color: #fff;
}

.strip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: inherit;
}

.strip-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
    text-align: center;
}

/* ===== FLYOUT PANEL ===== */
.sidebar-flyout {
    position: fixed;
    left: 68px;
    top: 0;
    bottom: 0;
    width: 260px;
    background: #2e2e2e;
    border-right: 1px solid #444;
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.flyout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    border-bottom: 1px solid #444;
}

.flyout-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.flyout-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.flyout-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.flyout-body {
    padding: 12px 0;
    flex: 1;
}

/* Flyout groups (columns of links) */
.flyout-group {
    padding: 0 0 16px 0;
}

.flyout-group-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 20px 6px;
}

.flyout-link {
    display: block;
    padding: 9px 20px 9px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 400;
    transition: background 0.12s, color 0.12s;
}

.flyout-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.flyout-link.active {
    color: var(--brand-primary, #4CAF50);
    font-weight: 600;
}

/* ===== APP WRAPPER — offset by strip width ===== */
.app-wrapper {
    margin-left: 68px;
    transition: margin-left 0.25s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Content area max-width */
.app-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ===== BACKDROP (flyout + mobile) ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.sidebar-backdrop.visible {
    display: block;
}

/* ===== MOBILE TOGGLE ===== */
.sidebar-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #999;
    border-radius: 6px;
    transition: background 0.15s;
    min-height: auto;
    line-height: 1;
}

.sidebar-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ===== MOBILE (<=768px) ===== */
@media (max-width: 768px) {
    .sidebar-strip {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1001;
        transition: transform 0.25s ease;
    }

    .sidebar.open .sidebar-strip {
        transform: translateX(0);
    }

    .sidebar-flyout {
        left: 68px;
    }

    .app-wrapper {
        margin-left: 0 !important;
    }

    .sidebar-mobile-toggle {
        display: flex;
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar,
    .sidebar-backdrop,
    .sidebar-mobile-toggle {
        display: none !important;
    }

    .app-wrapper {
        margin-left: 0 !important;
    }
}
