/* Google-style module launcher */
.module-launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0;
}

.module-launcher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.module-launcher-btn:hover,
.module-launcher-btn.is-open {
    background-color: rgba(60, 64, 67, 0.08);
}

/* 9-dot grid icon (Google style) */
.module-launcher-grid-icon {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(3, 4px);
    gap: 3px;
}

.module-launcher-grid-icon span {
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #5f6368;
}

/* Launcher panel */
.module-launcher-panel {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15), 0 0 2px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    overflow: hidden;
}

.module-launcher-panel.is-open {
    display: block;
    animation: moduleLauncherFadeIn 0.15s ease-out;
}

@keyframes moduleLauncherFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.module-launcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
}

.module-launcher-title {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
}

.module-launcher-body {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px 12px 12px;
}

.module-launcher-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.module-launcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border-radius: 12px;
    text-decoration: none;
    color: #202124;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.module-launcher-item:hover {
    background-color: rgba(60, 64, 67, 0.06);
    color: #202124;
}

.module-launcher-item.is-active {
    background-color: var(--smart-primary-soft, rgba(91, 141, 239, 0.12));
}

.module-launcher-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 22px;
    background: var(--smart-primary-light, #eef4ff);
}

.module-launcher-item-label {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}

.module-launcher-empty {
    text-align: center;
    padding: 32px 16px;
    color: #5f6368;
}

.module-launcher-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.module-launcher-empty p {
    margin: 0 0 4px;
    font-weight: 500;
}

.module-launcher-footer {
    border-top: 1px solid #e8eaed;
    padding: 10px 16px;
    text-align: center;
}

.module-launcher-dashboard-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--smart-primary, #5b8def);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    transition: background-color 0.15s ease;
}

.module-launcher-dashboard-link:hover {
    background-color: var(--smart-primary-soft, rgba(91, 141, 239, 0.12));
    color: var(--smart-primary, #5b8def);
}

/* Ensure panel stays above topbar content */
#page-topbar .module-launcher-panel {
    z-index: 9999 !important;
}

/* Scrollbar styling */
.module-launcher-body::-webkit-scrollbar {
    width: 6px;
}
.module-launcher-body::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}
